logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

You are write a 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. 

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Assignment:

1) Consider the following computer programming problem

In one of the earlier sample programs, we did a car price calculator which used if..else statements to take a number of options and compute a total price. Here we will do something in a similar vein but with arrays.

You are to write a 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. 

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 level

HE

 

7500.00

 

Luxury

UC

 

5220.00

 

User specified


Your program first 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. 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.

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

762 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

894 Answers

Hire Me
expert
Husnain SaeedComputer science

929 Answers

Hire Me
expert
Atharva PatilComputer science

525 Answers

Hire Me

Get Free Quote!

333 Experts Online