The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 364 Weeks Ago, 2 Days Ago |
| Questions Answered: | 1850 |
| Tutorials Posted: | 1850 |
Graduate in Biology and Nutrition, MBA Finance
Florida State University
Aug-2000 - Jul-2007
Ass. Relationship Manager
Penn-Florida
Mar-2009 - Feb-2016
Hello,
This is for my CS202 class where we are coding in c++. I am having a difficult time with just printing out ALL data for all cars. I know my readFile function needs adjustment, I just do not know how.
Â
Description:
For this project, you are to create a program that will assist users who want to rent a car. You are given a datafile with 10 different cars, and you must read in all of the car data from the file and store it in an array of structs. You must also create a menu with the functionality defined below. Although an example file is provided, for grading purposes your project will be tested against a different test file that will not be provided to you beforehand. Our test file will be in the same format as the example file.
Â
The RentalCar struct will contain the following data members:
-Â make, a C-style string
-Â model, a C-style string
-Â year, an int
-Â price, a float (price per day)
-Â available, a bool (1 = true; 0 = false; try to display true/false using the "boolalpha" flag, optional)
Â
The menu must have the following functionality:
- Read ALL data from file.
-Â Print out ALLÂ data for all of the cars.
- Estimate car rental cost - prompt the user for a car number (first car in file should be
represented to the user as #1), and the number of days to rent the car.
- Find the most expensive car.
- Print out ONLY the available cars.
- Exit program.
Â
The following minimum functionality and structure is required:
- Ask the user for the input file name.
- The list of cars must be stored in an array of structs.
- Use character arrays (i.e., C-style) to hold your strings. No string data type!
- Write multiple functions (Hint: each menu option should be a function).
- You can use pass by reference in your function.
- Write your own string copy, string compare (or other) functions as needed.
- The other functionality and structure of the program should remain the same as Project #1, including writing to screen and file and restrictions on string libraries, global variables and constants, etc.
Attachments:Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â----------- -----------Tha-----------nk -----------you----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------.Pl-----------eas-----------e p-----------ing----------- me----------- on----------- ch-----------at -----------I a-----------m Â----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I