Design and implement a class called bus

Assignment Help C/C++ Programming
Reference no: EM13329176

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.

 

Reference no: EM13329176

Questions Cloud

Explain what is the wavelength of the photons emitted : what is the wavelength of the photons emitted by hydrogen atoms when they undergo n=3 to n=2 transitions. Calculate in nanometers. In which region of the electromagnetic spectrum does this radiation occur? A) visible B) Ultraviolet C) Microwaves D..
Determine what is the couples marriage penalty or benefit : In 2013, Lisa and Fred, a married couple, have taxable income of $300,000. If they were to file separate tax returns, Lisa would have reported taxable income of $125,000 and Fred would have reported taxable income of $175,000.
Create a constructor that initializes the data : 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.
Explain what is the ph during the titration of hac : What is the pH during the titration of 25.00mL of 0.10M HAc(aq) using .10M NaOH(aq) as the titrant, after the addition of 10.0, 25.0, and 30.0ml of titrant.
Design and implement a class called bus : Define the Bus constructor to accept and initialize all instance data. Include getter and setter methods for all instance data.
Will any of pats wages be exempt from social security : Pat Maninen earns a gross salary of $2,100 each week. Assume a rate of 6.2% on $106,800 for Social Security and 1.45% for Medicare. What are Pat's first week's deductions for Social Security and Medicare
Define the cheetah constructor to accept and initialize : Design and implement a class called Cheetah that contains instance data that represents the cheetah's name, age, weight, length and gender.
Calculate the escape velocity for a planet : Calculate the escape velocity for a planet that has twice the mass of Earth and is half the size of Earth
Find the work done on the jet by the catapult : A fighter jet is launched from an aircraft carrier with the aid of its own engines and a steam-powered catapult. The thrust of its engines is 3.26 x 105 N. What is the work done on the jet by the catapult

Reviews

Write a Review

C/C++ Programming Questions & Answers

  C program to solve the quadratic equation of rocket launch

Write a C program to solve the quadratic equation of rocket launch by computing the roots (t1 and t2) of that quadratic equation: gt2 + vt + l = 0 (or) for simplicity ax2 + bx + c = 0. Get the values of g, v, and l from the user. The program should d..

  Writing function that computes leap years

Write down function that computes leap years. Function prototype is as follows: Write function body which returns true if year is a leap year and false if year is not a leap year.

  Find the sixth maclaurin polynomial for sin x

Find the sixth Maclaurin polynomial for sin x and use Chebyshev economization to obtain a lesser-degree polynomial approximation.

  Write a program to find the middle element in a linked list

1. Write a program to check if there is a loop in a linked list. Create a loop in a linked list and use your method 'isLoop' to identify that the loop exists. The method isLoop should return a Boolean type.2.

  Write a program that will call a function

Write a program that will call a function called writeDataToFile to prompt a user for their first name, last name and zip code, and print this information to a file called "UserData.txt". The main function should prompt the user for the same infor..

  Write c program which has parent process and child process

Write a C program that has a parent process, a child process, and a grandchild process. The parent process should print its id and the square or 5.

  Bare in mind this is a program

Bare in mind this is a program with the audience being lawncare and landscaping people. So the events will generally be to know how often a client wants their lawn mowed.

  Sort an array of elements using the quick sort algorithm

Sort an array of 10,000 elements using the quick sort algorithm as follows: sort the array using pivot as the middle element of the array

  Write a c++ program to calculate the gpa of 5 courses

Write a C++ program to calculate the Gpa of 5 courses. When users enter the grades and credits of the courses from the keyboard

  Is a void function a function that does not return a value?

Is a void function a function that does not return a value?

  Input parameters, and returns nothing

Write a function called ten2one(), that takes no input parameters, and returns nothing (void). The body of the function must include a loop that counts from 10 down to 1, printing the count value each time in the loop. The output should look like (no..

  What information do you need to find the selling price

To make a profit, the prices of the items sold in a furniture store are marked up by 60%. Design an algorithm to find the selling price of an item sold at the furniture store. What information do you need to find the selling price?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd