value = 20,000 - (1,000 * age) Sample Execution 1 Enter the VIN for the vehicle: ABC123 How old is the vehicle (in years): 4 Has the vehicle been in an accident? Y How much damage was incurred to the vehicle (in dollars)? 15500 The value for vehicle ABC123 is $500.00 due to excessive damages Sample Execution 2 Enter the VIN for the vehicle: ABC123 How old is the vehicle (in years): 4 Has the vehicle been in an accident? N The value for vehicle ABC123 is $16,000.00
The two pictures uploaded are explaining the task



Algorithm of the code:
1. Create a function called getVIN that takes no parameters and returns a string
2. Create a function called getVehicleAge that takes no parameters and returns an integer
3. Create a function called askForAccidents that takes no parameters and returns a character
4. Create a function called computeValue that takes three parameters (an integer, a character, and a string) and returns no value
5. In the main function, call the getVIN function and store the returned value in a string variable
6. Call the getVehicleAge function and store the returned value in an integer variable
7. Call the askForAccidents function and store the returned value in a character variable
8. Call the computeValue function, passing in the integer, character, and string variables as parameters
9. If the character variable is 'Y', prompt the user for an integer and store it in a new integer variable
10. If the integer from step 9 is greater than 15000, print that the value for the vehicle is $500.00 due to excessive damages
11. If the integer from step 9 is not greater than 15000, calculate the value of the vehicle as 20000 - (1000 * age) and print the value
12. If the character variable is not 'Y', calculate the value of the vehicle as 20000 - (1000 * age) and print the value
13. End the program
Step by step
Solved in 4 steps with 4 images









