Question: You will now return to the regular program development process. 2. You are to write program which inputs the base price of a car. Then,

You will now return to the "regular" program development process. 2. You are to write program which inputs the base price of a car. Then, the program will input in a 2-letter code (a string) which corresponds to an option package.That package has a name and a cost which will be used by your code. All the 2 letter codes will be in an array (string), along with the corresponding cost of the package in a parallel array (doubles), and there is also another array with the name of the package (string). Here is the data for the 3 parallel arrays:

OptionPackageCodeArray

PackageCostArray

PackageNameArray

BB

1500.00

Base

SP

3250.00

Sport

NP

4575.00

Intermediate

HE

7500.00

Luxury

UC

5220.00

Custom

After getting the inputs, your program has to determine if the 2-letter code input by the user is valid. You are required to use a loop to check the input against each item in the optionPackageCodeArray. Begin with the first item then "walk" down through the array. If the code does NOT exist on the list, display an error message and stop. (Do NOT prompt the user to try again.) If the code is valid, do some calculation and displaying. First, add the base price to the package cost from the array and get a subtotal. Then, calculate 15% of the subtotal for taxes and fees and add that to the subtotal for a final price. Display the final price and the full name of the package from the last array, then stop. Notes: * You MUST define and use parallel arrays or you will get 0 points for this assignment. * You MUST use a loop and search to find if the code that was input matches an option package code in the array or you will get 0 points for this assignment. * Use doubles for ALL costs. Include dollar signs with your prompts and outputs and 2 decimal places for cents. * Keep the input prompts simple - do not show all the possible choices when prompting the user, for example. * Remember, if a wrong code is entered the program will catch and report that. * Do not use functions, just have one main ( ) for the whole program. * You will find that there are examples in your book and in this course that can be of help with this task * Don't forget to #include * Test your code. As an example, if we enter 34000 as the base price, and a code of HE, we should see The final cost for your vehicle with Luxury trim is $47725.00 * And, of course if we enter 17500 as the base price and a code of KL, we should see an error message 3. Write up an IPO chart for this problem. 4. Desk-check your solution. Figure some simple test data using various base prices and package codes. Extra Credit:

-Alter the IPO so if a user enters a bad package code, the program prompts for a code again. It will let the user try again up to 5 times. If a good code is entered, the program continues as normally. If not, and the 5 tries are up, display a "Sorry, you are out of tries" message and stop

-Once the IPO is tested, develop the C++ code. Call your project Hwk7Extra and your code carsExtra.cpp. If it all works, submit it INSTEAD of the regular solution.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!