Write the pseudocode for a program that determines the price of a car. The progr
ID: 662947 • Letter: W
Question
Write the pseudocode for a program that determines the price of a car. The program should ask the user the color of the car, the horsepower of the car, and whether or not the car comes with fuzzy dice. The base price of a car is $10,000. If the color is red, the price is increased 15%. If the color is yellow, the price is decreased 5%. All other colors don't affect the price of the car. If the horsepower of the car is greater than 200, $2,500 is added to the price of the car. If the car comes with fuzzy dice, the car's price is increased by $25. Compute and display the price of the car.
Explanation / Answer
Answer
1. Start
2. Read from command-line color of the car
3. Read from command-line horsepower of the car
4. Read from command-line whether or not the car comes with fuzzy dice
5. Intialize base price of a car is $10,000
6. Check If color is red
7. If true the price is increased 15% , price=base price + base price*15/100
8. Check If color is yellow
9. If true the price is increased 5% , price=base price - base price*5/100
10. else
11. price=base price
12. Check If horsepower of the car is greater than 200
13. If true the price is price= price + 2,500
14. Check If the car comes with fuzzy dice
15. If true the price is price= price + 25
16. Display the price of car
17. End
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.