Question: Write a C++ code: Question: ============================================================================================================================================================================================================================================ Below is a skeletion of the project. 1. Create a file named VehicleFleet.txt consisting of following data 5 45.00
Write a C++ code:
Question:

============================================================================================================================================================================================================================================
Below is a skeletion of the project.




1. Create a file named VehicleFleet.txt consisting of following data 5 45.00 1 2010 Toyota 2 2010 Honda 32011 Hyundai Elantra 4 2011 Ford 5 2011 Honda 6 2012 Toyota 7 2012 Honda s 2012 Mazda Camry Odyssey AVAILABLE AVAILABLE AVAILABLE AVAILABLE AVAILABLE AVAILABLE AVAILABLE AVAILABLE 60.00 Taurus Pilot Sienna S2000 Mazda6 30.00 40.00 70.00 75.00 150.00 45.00 5 The columns are foi The vehicle ID .The year of production. . The brand. . The model. . The number of seats. .The rental price .The renting status 2. Write a program doing the followings: . Define an enumeration type named VehicleStatus. It contains 2 values: AVAILABLE and RENTED . Define a structure named SAutomobile including year, brand, model and seats. . Define a structure named SRentalVehicle including id, vehicle (typed SAutomobile), price and status (typed VehicleStatus). Then. de ne an array of 8 elements or SRentalVehicle to store mormation of the vehicles in the file VehicleFleet.txt. Remember to instantiate the array by reading vehicle information from the file. Have a menu including the following options: o Listing all vehicles of the fleet. o Listing all available vehicles o Listing all rented vehicles. o Renting a vehicle o Returning a vehicle. o Quit For listing all vehicles of the fleet, list all of the information of all vehicles .For listing all available vehicles of the fleet, list all of the information of all available vehicles . For renting, do the following: o List all the available vehicles. o Update the availability of the newly rented vehicle to RENTED For returning, do the following: o Ask the customer which vehicle he she rented (based on the ID). Be sure that he she picks the right vehicle Id. Ifnot, raise an error message and go back to the menu. Ask the customer which vehicle he she picks based on the ID) Be sure that he she picks the right vehicle ld. If not, raise an error message and go back to the menu List all the rented vehicles. o Update the availability of the newly returned vehicle to AVAILABLE .For quitting, write the updated vehicle information back into the file VehicleFleet.txt 1. Create a file named VehicleFleet.txt consisting of following data 5 45.00 1 2010 Toyota 2 2010 Honda 32011 Hyundai Elantra 4 2011 Ford 5 2011 Honda 6 2012 Toyota 7 2012 Honda s 2012 Mazda Camry Odyssey AVAILABLE AVAILABLE AVAILABLE AVAILABLE AVAILABLE AVAILABLE AVAILABLE AVAILABLE 60.00 Taurus Pilot Sienna S2000 Mazda6 30.00 40.00 70.00 75.00 150.00 45.00 5 The columns are foi The vehicle ID .The year of production. . The brand. . The model. . The number of seats. .The rental price .The renting status 2. Write a program doing the followings: . Define an enumeration type named VehicleStatus. It contains 2 values: AVAILABLE and RENTED . Define a structure named SAutomobile including year, brand, model and seats. . Define a structure named SRentalVehicle including id, vehicle (typed SAutomobile), price and status (typed VehicleStatus). Then. de ne an array of 8 elements or SRentalVehicle to store mormation of the vehicles in the file VehicleFleet.txt. Remember to instantiate the array by reading vehicle information from the file. Have a menu including the following options: o Listing all vehicles of the fleet. o Listing all available vehicles o Listing all rented vehicles. o Renting a vehicle o Returning a vehicle. o Quit For listing all vehicles of the fleet, list all of the information of all vehicles .For listing all available vehicles of the fleet, list all of the information of all available vehicles . For renting, do the following: o List all the available vehicles. o Update the availability of the newly rented vehicle to RENTED For returning, do the following: o Ask the customer which vehicle he she rented (based on the ID). Be sure that he she picks the right vehicle Id. Ifnot, raise an error message and go back to the menu. Ask the customer which vehicle he she picks based on the ID) Be sure that he she picks the right vehicle ld. If not, raise an error message and go back to the menu List all the rented vehicles. o Update the availability of the newly returned vehicle to AVAILABLE .For quitting, write the updated vehicle information back into the file VehicleFleet.txt
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
