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

  Same birthday

How likely is it that two people in one section of our class (40 students) have the same birthday ?

  Write a program that calculates the average rainfall

Write a program that asks the user to enter five floating-point numbers. The program should create a file and save all five numbers to the file.

  Write a program to find that number for nguyen.

In some Asian countries, 8 and 6 are considered lucky digits. Any number containing only 8s and 6s is considered lucky number, e.g. 6, 8, 66, 668, 88, 886 .... Nguyen is a student who likes mathematics very much. Nguyen likes lucky numbers but only o..

  Write a function to arrange 10 numbers stored in an arraye

Writ a funtion to arrange 10 numbers stored in an array forom the largest to the smallest and pass the results to main program.

  Gcd between two positive integer numbers

Write a C++ code for calculating the GCD (Greatest Common Divisor) between two positive integer numbers. You  should  use Euclid's  original  subtraction  based  GCD algorithm ( not  using  modulo operator). You should write a function following t..

  Provide a class diagram for every user authored class

Examine the sample code you have been provided with. This code is for a simple Car Hire management system. It contains a number of classes.

  Write a function that computes length of a character string

Write a function that computes the length of a character string (i.e. write your own implementation of the strlen function.

  Write a function named vowelwords

Write a function named vowelwords(), that reads the file text1.txt and create a new file named text2.txt, which shall contain only those words from the file text1.txt which don’t start with an uppercase vowel(i.e., with ‘A’,’E’,’I’,’O’,’U’)

  Takes 100 number in an array

Write a program in c++ that takes 100 number in an array and add them and print the sum

  Illustrate example from ansi c programming language

Illustrate example from ANSI C programming language, without using nested procedures, to show the fact that "assignment-by-sharing in conjunction with quasi-dynamic object binding

  Write a program that finds the equivalent series

Write a program that finds the equivalent series and parallel resistance for a collection of resistor values. Your program should scan first the number of resistors and then the resistor values. Then compute the equivalent series resistance for all r..

  Translate than c source code

Why does Ada take so much more time to translate than C source code? What phase of the Ada translation takes the longest?

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