Create a C++ program that will create a car rental database. Doctor blake mysteries family portrait. Thedatabase will be an array of records (structs). Each record(struct) must be able to store the following information: license # (which serves as the car's id#) - will be a mixture ofletters and digits - example: CXF341 Suitable for let and occupied portfolios, Horizon's property management database holds all key property, lease, tenant, supplier and landlord information. Rental Information Systems has been dedicated to providing quality software to Rent-To-Own dealers since 1985. We have seen many changes in the industry over the years, and have kept our clients ahead of their competition by providing them with the most innovative, cost. make - string - example: Toyota model - string - example: Camray category - char or string (current categories are compact,standard, premium) rental status - suggested type bool - true means car iscurrently rented, false means car is available The maximum number of cars in the database will be 40. Interactively prompt for and read the name of the output file.All output should be written to this file (except prompts for filenames). Leave at least one blank line between each of the summariesthat will be generated. Prompt the user for the name of the first input file. Open the file for reading and store the car inventoryinformation into the array of records. Assume that all cars areavailable for rent and set the rent field accordingly. Write a summary to the file that displays all cars in theinventory. Summary must be nicely formatted (see sample output),include headings. Interactively prompt the user for the name of the second inputfile Open the file for reading and read each license #. Search the database for the license #. If it is found, changethe rental status of the car to rented and write a message statingthat the car was rented. Include the license #, make and model inthe message. If the license # could not be found (search failed),write an error message that includes the license #. Write a summary to the file that displays all the cars that arecurrently rented (nicely formatted, see sample). Determine each of the following and write messages to the outputfile for each: Determine how much rental income is due for the current day'srentals. Determine how many cars are currently rented. Determine how many cars are currently available. Write a summary to the file of all the cars in the inventory(nicely formatted, see sample). ASSUMPTIONS The maximum number of cars in the first data file will be40. The last line in the data file will be terminated by alinefeed. License plate #s, makes, and models will be in a mix of upperand lowercase letters and digits. Car types will be upper or lowercase P, S, and C. All data in the first data file will be valid. License #s areunique. A license # will not be repeated in the second (rental) datafile . REQUIREMENTS You MUST use an array of records (structs) to store theinventory. The program MUST make liberal use of functions to modularizecode. (Minimum required, including main is 4.) NO GLOBAL VARIABLES can be used. Pass parameters. Include all header files for data types/library functions usedby program. The names of the files must be prompted for and readinteractively. ASK FOR THE NAME OF THE OUTPUT FILE FIRST. Reformat license #s so that all letters are uppercase. Reformat make and model names so that the first letter iscapitalized, the rest are lowercase. Car type and rental status should be displayed in the summariesas words, not single characters or logical values (see sample). When displaying the summaries, neatly arrange the data incolumns, left justify words (maximum length 10 characters). Includeheadings for each column. Display daily income with a label, $ sign, and 2 digits to theright of the decimal. Sample terminal session:
0 Comments
Leave a Reply. |