Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE TYPE IN C++ PROGRAMMING LANGUAGE. PLEASE USE ARRAY AS WELL. Please type in C++ Programming language. Create a one dimensional array which holds the
PLEASE TYPE IN C++ PROGRAMMING LANGUAGE. PLEASE USE ARRAY AS WELL.
Please type in C++ Programming language.
Create a one dimensional array which holds the retail prices for product 1-5. This is the same problems as the assignment you already did, but instead of using the SWITCH statements you will use an array to get the same result. Product number Retail price 2 3 4 5 $2.98 $4.50 $9.98 $4.49 $6.87 Write a program that: 1. Initialize a one dimensional array with the retail prices, and then print the whole array content in one row with proper distance between each element of the array 2. Ask the user to choose between products 1-5 (-1 or any sentinel value to end), and then enter the quantity sold for that product. 3. Your code should calculate the total retail value of all products and display that value at the end. Hint: Use the product number entered by the user as the index of the retail price array to access the corresponding product's price. Multiply price by the product quantity and add to the sum totalStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started