Create a Vehicle class that contains the following members: Vehicle make; mileage; model; year; plateNumber; numSeats;...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a Vehicle class that contains the following members: Vehicle make; mileage; model; year; plateNumber; numSeats; Vehicle (make, model, year, mileage, plateNumber, Constructors numSeats) Vehicle (make, model, year, numSeats) getMake(): getModel(): getYear(): getMileage(): getPlateNumber(): getNumSeats(): setPlateNumber(): Class Data Members fareTotal; numOfFares; Create a derived Taxi class from Vehicle class that contains the following members: Taxi (inherits Vehicle class) Class All fields of Vehicle class are inherited and have Instance Variables these additional fields. taxild; Taxi (make, model, year, mileage, plateNumber, Constructor: numSeats, taxild) getID(): setID(): getFare Total(): addFare(): getNumOfFares: resetFareInfo(): default values: mileage = 0; plateNumber: "unknown" Functions default values: fareTotal = 0.0; numOfFares: 0 getID(): gives taxi ID getFare Total(): gives total fare addFare(): Adds new fare to existing fare and increments the Num of Fares by 1 getNumOfFares(): Gives total number of fares resetFareInfo(): resets Fare, NumOfFares to zero Design the main() function that prints the menu as sample output shown in figure. Create two taxi objects in main function. The data of any new taxi object should be saved in a file "taxi.txt". Show the list of taxi objects from the file using the menu options. Add Fare for taxi objects (by reading objects data from file) with values of your choice using addFare() function and save updated data back to file. Reset the Fare information for one of the taxi objects (in the file) using resetFare Info() function. A sample output could be as follows: 1- Show Taxi's List. 2- Add New Taxi. 13- Reset Taxi's Fare Information. 4- Add to Total Fare of a Taxi. Menu Please enter an option: 2 Please enter Taxi's make: Toyota Please enter Taxi's model: Camry Please enter Taxi's manufacturing year: 2015 Please enter Taxi's mileage: 140000 Please enter Taxi's plate Number: GF519 Please enter Taxi's number of seats: 5 Please enter Taxi's ID: 3 New Taxi List is: Sr. No 1 2 3 Make Toyota Honda Toyota Model Corolla Civic Camry Plate Number SR324 GW581 GF519 Do you have another operation to perform? y Year 2020 2022 2015 Mileage 10000 23000 140000 Taxi ID 123 Number of Seats 5 5 5 Number of Fares 0 0 0 Total Fare 0 : 0 0 Create a Vehicle class that contains the following members: Vehicle make; mileage; model; year; plateNumber; numSeats; Vehicle (make, model, year, mileage, plateNumber, Constructors numSeats) Vehicle (make, model, year, numSeats) getMake(): getModel(): getYear(): getMileage(): getPlateNumber(): getNumSeats(): setPlateNumber(): Class Data Members fareTotal; numOfFares; Create a derived Taxi class from Vehicle class that contains the following members: Taxi (inherits Vehicle class) Class All fields of Vehicle class are inherited and have Instance Variables these additional fields. taxild; Taxi (make, model, year, mileage, plateNumber, Constructor: numSeats, taxild) getID(): setID(): getFare Total(): addFare(): getNumOfFares: resetFareInfo(): default values: mileage = 0; plateNumber: "unknown" Functions default values: fareTotal = 0.0; numOfFares: 0 getID(): gives taxi ID getFare Total(): gives total fare addFare(): Adds new fare to existing fare and increments the Num of Fares by 1 getNumOfFares(): Gives total number of fares resetFareInfo(): resets Fare, NumOfFares to zero Design the main() function that prints the menu as sample output shown in figure. Create two taxi objects in main function. The data of any new taxi object should be saved in a file "taxi.txt". Show the list of taxi objects from the file using the menu options. Add Fare for taxi objects (by reading objects data from file) with values of your choice using addFare() function and save updated data back to file. Reset the Fare information for one of the taxi objects (in the file) using resetFare Info() function. A sample output could be as follows: 1- Show Taxi's List. 2- Add New Taxi. 13- Reset Taxi's Fare Information. 4- Add to Total Fare of a Taxi. Menu Please enter an option: 2 Please enter Taxi's make: Toyota Please enter Taxi's model: Camry Please enter Taxi's manufacturing year: 2015 Please enter Taxi's mileage: 140000 Please enter Taxi's plate Number: GF519 Please enter Taxi's number of seats: 5 Please enter Taxi's ID: 3 New Taxi List is: Sr. No 1 2 3 Make Toyota Honda Toyota Model Corolla Civic Camry Plate Number SR324 GW581 GF519 Do you have another operation to perform? y Year 2020 2022 2015 Mileage 10000 23000 140000 Taxi ID 123 Number of Seats 5 5 5 Number of Fares 0 0 0 Total Fare 0 : 0 0
Expert Answer:
Related Book For
Systems Analysis And Design With UML 2.0
ISBN: 9781118037423
4th Edition
Authors: Alan Dennis, Barbara Haley Wixom, David Tegarden
Posted Date:
Students also viewed these databases questions
-
The second programming project involves writing a program that examines a file of polynomials and determines whether the polynomials in that file are in strictly ascending order using two different...
-
Our first program will give you an opportunity to work with a simple class in Java. You can use any development environment of your choice. You will only need to submit the .java file. Specifications...
-
What is the potential difference across one wire of a 30-m extension cord made of 16-gauge copper wire carrying a current of 5.0 A?
-
Compute the net pay for each employee using the federal income tax withholding table in Figure 7.2. Assume that FICA OASDI tax is 6.2% on a wage base limit of $117,000; Medicare is 1.45% on all...
-
An undercover drug informant learned from a mutual friend that Philip Friedman "knew where to get marijuana." The informant asked Friedman three times to get him some marijuana, and Friedman agreed...
-
What is a transducer?
-
1. What options does Atrium have for acquiring a new system? 2. What are the pros and cons of in-house development versus purchasing a system? 3. If the decision is made to purchase a new system,...
-
6.17 S&W Metals, Inc. had the following information regarding its installment sales for 19A and 19B: 6.18 126 Installment sales 19A 19B $300,000 $500,000 Cost of goods sold 180,000 350,000 $120,000...
-
1: Set out the main stakeholders in the MG Rover business at the time of its collapse. How would you determine the relative importance of their stake? Please read the case study below carefully and...
-
5 percent interest per month. The sterilizer was delivered on August 23, 1996. The last payment was received on April 21, 1998. At the time of the last payment, the defendant still owed the plaintiff...
-
In 1988, the Upper Deck Company was a company with an idea for a better baseball card: one that had a hologram on it. By the 1990s, the firm was a major corporation worth at least a quarter of a...
-
In the spring of 1999, Source Associates, Inc. (Source), and Conrad A. Mamajek, Inc. (CAM), entered into a joint venture to act as a middleman for the sale of polymers manufactured by Mitsui...
-
XCBob, Inc. is an online motorcycle and ATV parts business from the owners home. XCBob entered into oral agreements with the defendant, Ed Tucker Distributers, for purchases of various materials to...
-
Nationwide Insurance developed a program to recruit new insurance agents by offering planning, training, and start-up financing to build self-sustaining agencies. These new agents would be...
-
Consider these lines, where s,t, ER 11: [x, y, z] = [2, 1, -4] + t[1, 3, 1] 12: [x, y, z] = [1, k, -3] + s[-1,1, -2] Determine the value of k so that l1 and 12 lie on the same plane.
-
In Exercises 1-2, rewrite each verbal statement as an equation. Then decide whether the statement is true or false. Justify your answer. 1. The logarithm of the difference of two numbers is equal to...
-
What is the primary goal of system testing?
-
When implementing the object persistence in an RDBMS, what types of issues must you address?
-
What is the purpose of the requirements definition?
-
If you were advising an investor interested in purchasing a sport franchise, what advice would you give?
-
What must players and agents understand about risk? How should an agent structure a players contract if it contains deferred compensation?
-
An owner of several sport assets holds the following portfolio: What is the beta of this portfolio? ASSET INVESTMENT BETA Team A $100,000,000 0.5 Team B $100,000,000 1.0 Facility A $100,000,000 1.5...
Study smarter with the SolutionInn App