Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that calculates the final sales price of a car, which includes additional optional packages along with sales tax. You may assume that

image text in transcribed
image text in transcribed
Write a program that calculates the final sales price of a car, which includes additional optional packages along with sales tax. You may assume that the base price of the car is $30,000. First ask the user to choose which optional packages they want. For the purposes of this program, the user is only permitted to choose one package. Your program should display a menu of the available packages. The user should enter the package by entering the letter associated with it. W A - Basic Model (+$0.00) B- All-Wheel Drive Package ($2,500) C- Sport Package (+$3,500) D-Luxury Interior (+5,000) E- Self Driving / Self Aware (+12,000) If the user enters an invalid letter you must continue asking them to enter a letter until they enter a valid choice. Once they've entered a valid letter then ask them for the sales tax rate in their state. You should clearly indicate if they should enter, for example. 7 or 0.07 for a 7% sales tax. Finally, your program should compute the final sales price as the base The user should enter the package by entering the letter associated with it. A - Basic Model (+$0.00) B- All-Wheel Drive Package ($2,500) C- Sport Package (+$3,500) D- Luxury Interior (+5,000) E- Self Driving / Self Aware (+12,000) If the user enters an invalid letter, you must continue asking them to enter a letter until they enter a valid choice. Once they've entered a valid letter, then ask them for the sales tax rate in their state. You should clearly indicate if they should enter, for example, 7 or 0.07 for a 7% sales tax. Finally, your program should compute the final sales price as the base price, plus the price of the chosen package, all multiplied by 1 + sales tax rate. For example, if the user chooses option D and there is a sales tax of 5%, then the final price would be $35.000 1.05 = $36.750. Your printout need not include, placeholders, but should be limited to two decimal places to indicate proper dollars/cents notation

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions