Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 5 : Problem 5 : Write a program to calculate a discount based on the quantity and the price of each item of purchasing.

Problem 5: 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.
I need answer with c++
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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 2 Lnai 6322

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

364215882X, 978-3642158827

More Books

Students also viewed these Databases questions

Question

What is the relationship between humans and nature?

Answered: 1 week ago