Answered step by step
Verified Expert Solution
Question
1 Approved Answer
use C++ Critical Thinking Exercise: Create the design for a program for a car lot. You will prompt the user for the specifications of a
use C++
Critical Thinking Exercise: Create the design for a program for a car lot. You will prompt the user for the specifications of a car and check your inventory to see if the car is on the car lot. The inventory is found in the file CarLot.dat. You will read in the inventory using the struct Cars defined in lab 11.1, exercise 5a. You will read data from an input file named CarLot.dat into a struct variable and the user's specifications into a struct. Since you do not want to lose the customer, ask the customer if they want a list of all vehicles that match some specifications or only the exact car being searched. Hint: Since you are only reading a record at a time and you loop until the end of file flag, if you need to go through the file again, you must clear all file flags using the clear function. The following specifications apply to the cars in the lot. Valid car types include (C)oupe, (M)inivan, or (S)UV. The coupe gets 25 mpg at a base cost of S15,000, and seats 4. The minivan gets 20 mpg at a base cost of $18,000. and seats 7. The SUV gets 18 mpg at a base cost of $22,000 and seats 5. CarLot.txt C 4 25 15000 green C 4 25 15000 yellow M 7 20 18000 silver S 5 18 22000 blue S 5 18 22000 silver S 5 18 22000 green C 4 25 15000 whiteStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started