Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribedPlease 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 total

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

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions

Question

draw a rooted tree

Answered: 1 week ago

Question

9. Describe the characteristics of power.

Answered: 1 week ago

Question

3. Identify and describe nine cultural value orientations.

Answered: 1 week ago