Create a method that calculates the time required to travel


Problem 1

Design and implement a class called Cheetah that contains instance data that represents the cheetah's name, age, weight, length and gender. Define the Cheetah constructor to accept and initialize the instance data. Include getter and setter methods for the name, age, weight, length and gender. Include a method to compute and return the age until maturity (15 months until mature). Include a toString method that returns a one- line description of the cheetah. Create a driver class called Safari, whose main method instantiates and updates at least 3 cheetah objects.

Problem 2

Design and implement a class called Bus that represents any bus route. It should contain instance data that represents the Bus Route Line, Number Of Stops on the line, and the Bus's starting point and final stop, the distance between each stop (assume the distance is the same), the speed of the bus, and the time spent at each stop.Define the Bus constructor to accept and initialize all instance data. Include getter and setter methods for all instance data. Create a method that calculates the time required to travel between the starting point and stopping point of the line based on a given speed.

Include a toString method that returns a one-line description of the Bus trip including bus line, number of stops, origin and destination stops, distance between the beginning and end of the line, and the time required to travel between the beginning and ending stops at a given speed and the number of stops. Create a driver class called BusTrip, whose main method instantiates and uses at least 3 Bus objects.

Problem 3

Create a class called Simple Question and Answer that contains instance data for a simple mathematical question (i.e. What is 5*4?) and for the answer (i.e. 20).Create a constructor that initializes the data.Create a method that returns the question.Create a method that returns that answer. In the driver, you should ask the user if they want to play a simple game and then have them answer at least 5 questions.(you do not need a loop for this) You will create questions with randomized numbers being passed into the constructor. After the user answers the question, just put the actual answer down below the one entered. You do not need to check if they were correct.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Create a method that calculates the time required to travel
Reference No:- TGS0667837

Now Priced at $70 (50% Discount)

Recommended (95%)

Rated (4.7/5)