Tesla Motors Decided Hire Create Vehicle Configurator Based Various Parameters Goal Determ Q43899238
Tesla Motors has decided to hire you to create a vehicleconfigurator. Based on various parameters, the goal is to determinethe purchase price of a new car.
Here is an example of a dialog for the program I am asking youto create (user input is in boldface):
Which vehicle would you like to order? 3Which kind would you like? Long RangeWhat exterior color would you like? WhiteWhich wheels would you like? 18Want leather interior? No Want Auto-Pilot? NoEnjoy your new $47990.00 White Model 3!
The following table shows the costs your program should workwith:
Tesla Vehicle CostsModel 3 Model S Model X Base Price – Long Range$47,990$79,990$84,990Base Price – Performance$55,990$99,990$104,990Exterior Color-Whiteno cost optionno cost optionno cost optionExterior Color-Black$500$1,000$1,000Exterior Color-Blue$1,000$1,500$1,500Exterior Color-Grey$1,000$1,500$1,500Exterior Color-Red$1,500$2,500$2,500Wheels-Regular Size18 inch – no cost option19 inch – no cost option . 20 inch – no cost option . Wheels-Large Size19 inch – $1,50021 inch – $4,50022 inch – $5,500Leather$1,000$1,000$1,000Auto-Pilot$6,000$6,000$6,00
Here’s a few other examples to give you a sense of how it shouldwork:
Which vehicle would you like to order? 3Which kind would you like? Long RangeWhat exterior color would you like? YellowWhich wheels would you like? 18Want leather interior? No Want Auto-Pilot? NoError – Incorrect color choice.Which vehicle would you like to order? S Which kind would you like? PerformanceWhat exterior color would you like? WhiteWhich wheels would you like? 21 Want leather interior? No Want Auto-Pilot? NoEnjoy your new $104490.00 White Model S!
Your program must collect the information for one vehicle in themanner indicated by the examples, and then write to cout exactlyone line in a format required below. Our grading tool will judgethe correctness of your program by examining your output . Thatline you write must be in one of the following seven forms; thetext must be identical to what is shown (exceptthat the italicized ccc should be the appropriate colorvalue supplied by the user and the italicized v should be thevehicle model supplied by the user:
- If the user enters a vehicle value which is not “3” or “S” or”X”:
Error – Incorrect model choice. - If the user enters a kind value which is not “Performance” or”Long Range”:
Error – Incorrect kind choice. - If the user enters a color value which is not “White”, “Black”,”Blue”, “Grey” or “Red”:
Error – Incorrect color choice. - If the user enters a wheel value which is not 18 or 19 for aModel 3, 19 or 21 for a Model S, or 20 or 22 for a ModelX:
Error – Incorrect wheel value. - If the user enters a leather value which is not “Yes” or”No”:
Error – Incorrect leather choice. - If the user enters an autopilot value which is not “Yes” or”No”:
Error – Incorrect autopilot choice. - Otherwise:
Enjoy your new .$ ccc Model v!
The lines you write must not start with any spaces. If you arenot a good speller or typist, or if English is not your firstlanguage, be especially careful about duplicating the messagesexactly. Here are some foolish mistakes that maycause you to get no points for correctness on this project, nomatter how much time you put into it:
- Writing any extra spaces on the output line.
- Writing more than one line of output. Don’t, for example, add agratuitous “Thank you for using my great vehicle calculator!”
- Writing lines to cerr instead of cout.
- Writing lines like these:
Enjoy your new $47990.00 White Model 3 missingexclamation
Enjyy your new $47990.00 White Model 3! misspelling
ENJOY YOUR NEW $47990.00 WHITE MODEL 3! wrongcapitalization
Enjoy your new $47990.00 White Model 3 ! extraspaces
Enjoy your new $47990 While Model 3! incorrectnumber format
Your program must gather the model value, the kind value, thecolor value, the wheels value, the leather value and an autopilotvalue, in that specific order. However, if you detect an error inan item, you do not have to request or get the remaining items ifyou don’t want to; just be sure you write to cout the requirederror message and nothing more after that. If instead you choose togather all input first before checking for any errors, and youdetect more than one error, then write only the error message forthe first erroneous input item.
You will not write any loops in this program. This means thateach time you run the program, it handles only one vehicleconfiguration. It also means that in the case of bad input, youmust not keep prompting the user until you getsomething acceptable; our grading tool will not recognize thatyou’re doing that.
The correctness of your program must not depend on undefinedprogram behavior. Your program could not, for example, assumeanything about n’s value at the point indicated:
int main(){int n;int m = 42 * n; // n’s value is undefined
What you will turn in for this assignment is a zip filecontaining these three files and nothing more:
- A text file named vehicle.cpp that containsthe source code for your C++ program. Your source code should havehelpful comments that tell the purpose of the major programsegments and explain any tricky code.
- A file named report.doc orreport.docx (in Microsoft Word format) orreport.txt (an ordinary text file) that containsin addition your name and your IdNumber:
- A brief description of notable obstacles you overcame. (InProject 1, for example, some people had the problem of figuring outhow to work with more than one version of a program in VisualC++.)
- A list of the test data that could be used to thoroughly testyour program, along with the reason for each test. You don’t haveto include the results of the tests, but you must note which testcases your program does not handle correctly. (This could happen ifyou didn’t have time to write a complete solution, or if you ranout of time while still debugging a supposedly completesolution.)
Expert Answer
Answer to Tesla Motors has decided to hire you to create a vehicle configurator. Based on various parameters, the goal is to deter…
OR