Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 5 : I need anawer with ( c + + ) Problem 5 : Write a program to calculate a discount based on the

Problem 5: I need anawer with (c++)Problem 5: Write a program to calculate a discount based on the quantity and the price of each item of purchasing. The program prompts the user to insert the positive purchased number of items (num should be positive) and the price of each item. The program calculates the price after discount as follows:
discount(num)={nochange,num10normalprice**0.2,10num20normalprice**0.3,20num50normalprice**0.4,50num100normalprice**0.5,num>100
Input /Output Samples:
Bnter quantity of purchasing: -2 Invalid quantity
Enter the quantity of purchasing: 10
Enter the price of each item: 30
You have bought 10 peices
The normal price is 300
The price after discount is:240
.. Program finished with exit code 0
Press ENTER to exit console.
input
image text in transcribed

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

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Eric Redmond ,Jim Wilson

1st Edition

1934356921, 978-1934356920

More Books

Students also viewed these Databases questions

Question

2. How should this be dealt with by the organisation?

Answered: 1 week ago

Question

explain what is meant by the term fair dismissal

Answered: 1 week ago