1- int a = 1, b = 0; %3D if (a < 0 && b> -1) {a = b = 23 ;} cout << x << " "
Q: Language: JAVA Leap-Year Write a program to find if a year is a leap year or not. We generally…
A: import java.io.*;import java.util.*;class LeapYear { public static void main(String args[]) throws…
Q: 3.17 (Game: scissor, rock, paper) Write a program that plays the popular scissor–rock–paper game.…
A: Answer :
Q: Activity #2: Taking limits to compute derivatives Write a program named Lab5a_Act2.py to compute a…
A: Actually. Python is a easiest programming language. It is a dynamically typed programming language.
Q: **3.19 (Geometry: point in a circle?) Write a program that prompts the user to enter a point (x, y)…
A: Step-1: StartStep-2: Declare variable x, y, distanceStep-3: Calculate distance by using square root…
Q: LIFE INSURANCE PREMIUM CALCULATOR Write a C program that calculates monthly, quarterly, half-yearly…
A: Please find the answer below :
Q: V/ This pseudocode segment is intended to compute and display // the average grade of three tests…
A: The program is made up of 3 components called by the primary program. These components are:…
Q: A BOOKSTORE SELLS BOOKS UNDER THE FOLLOWING CONDITIONS: a. IF THE CLIENT IS TYPE 1, 30% IS…
A: Program: //header file #include <iostream> using namespace std; //main function int main()…
Q: C CODE PLEASE 3.28 Fixed LAB: Warm up: Automobile service cost (1) Prompt the user for an…
A: Introduction: C CODE PLEASE 3.28 Fixed LAB: Warm-up: Automobile service cost (1) Prompt the…
Q: use visual basic Depreciation to a Salvage Value of 0 . For tax purposes an item may be depreciated…
A: Design
Q: 1. execute the program in the background 2. obtain process status 3. show to the zombie child…
A: The Program referenced in the question Lab7.c ,creates a Zombie process. The program creates a…
Q: aucts are sóld from a vending machine, which has two push buttons P, and P. When a button is…
A: Introduction :Here we have asked to calculate the expression for "d"
Q: , c) write a piece of code in C# that calculates the area of a triangle displaying the area in the…
A:
Q: ** 16.3 (Traffic lights) Write a program that simulates a traffic light. The program lets the user…
A: (Trafic lights) Write a program that simulates a traffic light. The program lets the user select one…
Q: C# Code: There are two A, B players playing the game. Player A is angry with him, and player B is…
A: Problem Explanation: If A adds 'a' to w in the first movement, B can add 'a' and form a string w =…
Q: n C++, using STL algorithms, iterators, or containers get the total from the textfile icecream.txt.…
A: program: #include <iostream>#include <fstream>#include <string>#include…
Q: int i = 0; while (i ! = 4) %3D { System.out.print(i + " "); i++; if (i == 4) {…
A: Java programming is an object-oriented programming language, that's used to build web browser…
Q: function name: cap_at_100 o parameters: a number grade • returns: the grade with a maximum of 100 o…
A: In python a function is defined using syntax def Function-Name( Parameter1,Parameter2,. . . .…
Q: A 4th grader is having trouble with Permutation and Combination problem in Mathematics, so a friend…
A: #include <iostream>#include "functions.h" using namespace std; int main(){ while(true)…
Q: Suppose that classStanding is a char variable, gpa and dues are double variables. Write a switch…
A: Program: //include the header file #include <iostream> using namespace std; //definition…
Q: Print "user_num1 is negative." if user_num1 is less than 0. End with newline. Assign user_num2 with…
A: logic:- read first number if number1<0 display number1 is less than 0 read second number if…
Q: 7) Solving quadratic equation program Let's consider the general formula of a quadratic equation :…
A: Required: Python program to solve the quadric equation. Required code with comments for…
Q: Q5: Complete the function that calculates the position of an object at any time t> 0. The initial…
A: code def calculate_position(s0,u0,a,t): position = u0*t + 0.5*a*t*t position=position+s0…
Q: T/F 9) The assignment statement d = p; is legal even though d is not a Poodle.
A: Please find the answer to the above question below:
Q: int fun7 (int a) pushl rbp movi krap, Szbp movi 8(krbp),teax sali 54, teax addi 8(rbp), leax addi…
A: To do: which function compiled into assembly code
Q: An Auto Insurance Program Example - Write a program to determine the cost of an automobile insurance…
A: Program approach: Import Scanner package for input. Create a class. Create the main method. Create…
Q: Project 9-1: Interest Calculator Create a program that calculates the interest on a loan. Console…
A: Here I have used an infinite loop. Inside the loop, I have taken input from the user and then…
Q: PYTHON programming solotion Develop a program that allows the user to enter a start value of 1 to…
A: I have provided PYTHON CODE along with CODE SCREENSHOT and OUTPUT…
Q: code for this in C: In college, a student may get a grade of 1.0 (as the highest) to 5.0(lowest).…
A: PROGRAM CODE: The challenge is how to use the supplied formula to highlight the final grade, and…
Q: blä: 3 This code program enters the value of x then the value of y is computed from one of the…
A: Required : To select proper statement from the given options.
Q: Activities at Lake LazyDays As activity directory at Lake LazyDays Resort, it is your job to suggest…
A: ANSWER:-
Q: (Physics: acceleration) Average acceleration is defined as the change of velocity divided by the…
A: Precise Acceleration is characterized as the time pace of progress of rakish speed. It is normally…
Q: *4.6 (Random point on a circle) Write a program that generates three random points on a circle…
A: Here is the java program: public class Main { public static void main(String[] args) { final…
Q: c. Engineering Application: Electric Field for an Insulating Sphere of Charge Use filename:…
A: #include <iostream> #include <cmath> using namespace std; const double Q = pow(10,-9);…
Q: An Auto Insurance Program Example - Write a program to determine the cost of an automobile insurance…
A: Program Explanation – Import the essential java libraries. Declare the class named as Main.…
Q: Code a game of sudoku in C++ where the user needs to guess the missing numbers in the grid. The grid…
A: The code implementation is given in the below steps.
Q: Jane has opened a new fitness center with charges of 2500 per month so the cost to become a member…
A: Note : I have added the output screenshot. Also with total money made, the code prints members and…
Q: Q5: Complete the function that calculates the position of an object at any time t> 0. The initial…
A: Input : Given the s0,u0, a, and t. Output : Value of position.
Q: void (double a) cout<<"" a = "; cout<<a<<endl; ... %3D
A: Given:
Q: valuate the following expression: (3 % 5)
A: need to evaluate the following expression: (3 % 5)
Q: change normal body temperature to 36.5–37.5 °C #include using namespace std; int main() { float…
A: Given, Change the code so that normal body temperature is 36.5–37.5 °C
Q: ii. int x 55, y = 5; switch (x % 7) { case 0: case 1: y++; case 2: case 3: yy + 2; case 4: break;…
A: Dear Student, It is given that x = 55 and y = 5 , And x divided by 7 gives an remainder 6 thus x%7 =…
Q: Activity #2: Taking limits to compute derivatives Write a program named Lab5a_Act2.py to compute a…
A: Since you are asking multiple questions, we are answering first question for you. If you want…
Q: Write an application that handles a student report card. The application shall save the marks of…
A: Solution C# PROGRAM using System; //computer science, maths, english //75 congratulationa, else…
Q: Bob takes medication three times a day. In the morning at 8:00, in the afternoon at 13:00, and in…
A: Dear Student, As no programming language is mentioned so I am assuming the programming language to…
Q: Engineering 3.1.10 The average person can jump off the ground with a velocity of 7 mph without fear…
A: Input : Input G,M,R values Velocity Output : Jumper will not return to the surface or not.
Q: What would be displayed as the daily dosage of medicine to be administered to a dog weighing 4…
A: Hello Student
Q: Jane has opened a new fitness center with charges of 2500 per month so the cost to become a member…
A: Program: //include the required header files #include <iostream> #include <string>…
Q: : Correct the syntax errors void Main () { int x, Y; const a = 14; ww w cin >> x , y; ww if a=x*y;…
A: Things needed to be remember:- c++ is a case sensitive programming language. if you need to use…
What are the output from the codes segment sbelow
Step by step
Solved in 2 steps
- 9. Trivia Game In this programming exercise, you will create a simple trivia game for two players. The program will work like this: Starting with player 1, each player gets a turn at answering 5 trivia questions. (There should be a total of 10 questions.) When a question is displayed, 4 possible answers are also displayed. Only one of the answers is correct, and if the player selects the correct answer, he or she earns a point. After answers have been selected for all the questions, the program displays the number of points earned by each player and declares the player with the highest number of points the winner. To create this program, write a Question class to hold the data for a trivia question. The Question class should have attributes for the following data: A trivia question Possible answer 1 Possible answer 2 Possible answer 3 Possible answer 4 The number of the correct answer (1, 2, 3, or 4) The Question class also should have an appropriate _…9. Trivia Game In this programming exercise, you will create a simple trivia game for two players. The program will work like this: Starting with player 1, each player gets a turn at answering 5 trivia questions. (There should be a total of 10 questions.) When a question is displayed, 4 possible answers are also displayed. Only one of the answers is correct, and if the player selects the correct answer, he or she earns a point. After answers have been selected for all the questions, the program displays the number of points earned by each player and declares the player with the highest number of points the winner. To create this program, write a Question class to hold the data for a trivia question. The Question class should have attributes for the following data: A trivia question Possible answer 1 Possible answer 2 Possible answer 3 Possible answer 4 The number of the correct answer (1, 2, 3, or 4) The Question class also should have an appropriate _…C# (Odd or Even) Write an app that reads an integer, then determines and displays whether it’s odd or even. (Hints: use the remainder operator) (Multiples) Write an app that reads two integers, determines whether the first is a multiple of the second, and displays the result. (Hints: use the remainder operator). Create a class called Date that includes three pieces of information as auto-implemented properties: a month (type int), a day (type int), and a year (type int). Your class should have a constructor that initializes the three fields. Provide a method DisplayDate() that displays the three fields (separated by '/'). Write a test app named DateDemo that demonstrates class Date’s capabilities.
- C++ Stars This lab exercise will practice creating objects with constructors and destructors and demonstrate when constructors and destructors are called. Star Class Create a class, Star. A Star object has two member variables: its name, and a solar radius. This class should have a constructor which takes a std::string, the name of the star, and a double, the solar radius of the star. In the constructor, the Star class should print to the terminal that the star was born. For example, if you create a Star as follows: Star my_star("Saiph", 22.2); Then the constructor should print: The star Saiph was born. In the destructor, the Star class should print to the terminal that the star was destroyed, along with the number of times the volume of the sun that that star was, formatted to two decimal places. Hint: use the following line to set the precision to 2 decimal places: std::cout << std::fixed << std::setprecision(2); For example, when my_star above has its destructor called,…The Spider Game Introduction: In this assignment you will be implementing a game that simulates a spider hunting for food using python. The game is played on a varying size grid board. The player controls a spider. The spider, being a fast creature, moves in the pattern that emulates a knight from the game of chess. There is also an ant that slowly moves across the board, taking steps of one square in one of the eight directions. The spider's goal is to eat the ant by entering the square it currently occupies, at which point another ant begins moving across the board from a random starting location. Game Definition: The above Figure illustrates the game. The yellow box shows the location of the spider. The green box is the current location of the ant. The blue boxes are the possible moves the spider could make. The red arrow shows the direction that the ant is moving - which, in this case, is the horizontal X-direction. When the ant is eaten, a new ant is randomly placed on one of the…C++ Coding Help (Operators: new delete) Assign pointer myGas with a new Gas object. Call myGas's Read() to read the object's fields. Then, call myGas's Print() to output the values of the fields. Finally, delete myGas. Ex: If the input is 14 45, then the output is: Gas's volume: 14 Gas's temperature: 45 Gas with volume 14 and temperature 45 is deallocated. #include <iostream>using namespace std; class Gas { public: Gas(); void Read(); void Print(); ~Gas(); private: int volume; int temperature;};Gas::Gas() { volume = 0; temperature = 0;}void Gas::Read() { cin >> volume; cin >> temperature;} void Gas::Print() { cout << "Gas's volume: " << volume << endl; cout << "Gas's temperature: " << temperature << endl;} Gas::~Gas() { // Covered in section on Destructors. cout << "Gas with volume " << volume << " and temperature " << temperature << " is deallocated."…
- Java Questions - (Has 2 Parts). Based on each code, which answer out of the choices "A, B, C, D, E" is correct. Each question has one correct answer. Thank you. Part 1 - 9. In Java, composition is said to use __ relationship. A. is-aB. part-ofC. has-aD. both is-a and part-ofE. both has-a and part-of Part 2 - 10. Given the following code, which statement is true? class Water() { ... }class Juice() extends Water { ... }class Apple() { ... }class ApplePie() { Apple a1 = new Apple(); }class AppleJuice() { Apple a1 = new Apple(); Water w1 = newWater(); } A. Juice is a superclass and Water is a subclass.B. ApplePie is a superclass of Apple.C. ApplePie is a composite class that contains an instance of Apple class.D. AppleJuice is a superclass that contains an instance of Apple class and an instance of Water.E. Water is a composite class that contains an instance of Juice.please use c# (Rectangle Class) Create class Rectangle. The class has attributes length and width, each of which defaults to 1. It has read-only properties that calculate the Perimeter and the Area of the rectangle. It has properties for both length and width. The set accessors should verify that length and width are each floating-point numbers greater than 0.0 and less than 20.0. Write an app to test class Rectangle. explain each step wellInstructionsDefine an enumeration type triangleType that has the values scalene, isosceles, equilateral, and noTriangle.Write a function triangleShape that takes as parameters three numbers, each of which represents the length of a side of the triangle. The function should return the shape of the triangle. (Note: In a triangle, the sum of the lengths of any two sides is greater than the length of the third side.)Write a program that prompts the user to input the length of the sides of a triangle and outputs the shape of the triangle.
- Overload the assignment operators (=) for Box class. Your operator must be able to do multi-level assignments, e.g., statements like “b3 = b2 = b1;” must work as expected. A sample output is given below: Distance d1: 3'-9" Distance d2: 3'-6" After assigning d1 to d2 to d3 Distance d1: 3'-9" Distance d2: 3'-9" Distance d3: 3'-9" using c++C++ PROGRAM STRING MANIPULATION Create a class Class1 with a string data member ‘paragraph’. Provide a constructor and getParagraph() method in the class. The constructor just assigns NULL to the data member. getParagraph() method must read a paragraph from user. The paragraph should contain at least 30 words. If there are less than 20 words, the program must ask user to enter paragraph again. Create another class Class2, and make it a friend of the class Class1. Provide a function getSubString(Class1 &obj1, int startIndex, int lastIndex) with return type string in the class Class2 which accepts an object of class Class1 (by reference) and two integers. The getSubString() function should return the substring starting from location startIndex and ending at location lastIndex. Class2 must also contain a store() function that stores the substring in a file. Print screenshot of substring stored in file as well.Task 3: Properties (Assignment)You have to write a program for an estate agency. The program must manage renting of properties. Your solution must implement the concepts of encapsulation and inheritance.Information required on all the properties listed to be rented: Type of property (residential (R) or business (B)), name of the owner, contact number of owner, duration of the contract (in months).Residential: Type of property (Flat, Townhouse or House), number of bedrooms, number of bathrooms, number of garages, rent per month.Business: Size in square meters, insurance per month, rent per month.Two separate reports must be displayed for the two types of properties. The output for residential properties must be displayed as follows:Owner Contact number Months Type BedR BathR Rent(pm)Joe Bloom 0879678223 24 T 4 3 R19000The rent for residential properties depend on the type of property and the number of bedrooms.Flat – R8000pm + R 500pm per bedroomTownhouse – R…