Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider a retail store where five different items are sold. The D, price and discount percentage of each item is provided in the table below:

image text in transcribed
image text in transcribed
Consider a retail store where five different items are sold. The D, price and discount percentage of each item is provided in the table below: ItemID Price Discount S801 12.59 02 10.95 10% 0% S803 3.98 S804 402 E5% 20.68 5805 Calculate the price of all items before discount, after discount, subtotal (the total before tax, total tax and final total of all the purchase made by a customer. Create three functions and a main function. Details of each function are given below. 1) Main function Declare the array item IDO, item price and discounted item pricell of type double with 10 elements. Prompt the user to enter the number of items purchased and store it in a variable. Since the store sells 5 items only, validate this number to be in the range of 05. Call functions getltemID, calculateltemPrice, calculateTotalPrice from the main and let all these functions be of type void. Add a loop in main that allows the user to repeated the same until he/she chooses to exit. 2) getitemID function Inputs to this function are number of items and item IDI) Prompt the user to enter the item IDs in the range of 5801-5805 and store it in an array type variable. Perform validation to make sure the entered IDs are in the range. 3) calculateltemPrice function Inputs to this function are number of items, item IDDL item pricell and discounted item pricel]. Using the information from the table above, store the price values of respective item ID in the array element item price O. Calculate the price after the discount percentage and store the value in the array variable discounted item pricel] Print the values of item pricell and discounted item pricell, only for the item ID's entered by the user. 4) calculate TotalPrice function

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

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

Differentiate the function. r(z) = 2-8 - 21/2 r'(z) =

Answered: 1 week ago

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago