C++ program of the given sentences below.
Initialize amount and discount as double. Input the purchase amount.
Compute discount using the following criteria If amount is less than 1000, discount is zero.
If amount is more than 1000 up to 5000, discount is 100.
If amount is greater than 5000, discount is 5% of amount.
Display discount.​


Sagot :

Answer:

مرحبًا يا تجمع بالنسبة لي والمزيف الحقيقي مني 1000 إلى منمنh

Answer:

0.05

Explanation:

Get two inputs quantity and price from user using scanf statement

Calculate amount by using the expression amount = quantity * price

Check whether amount is greater than 5000 using if statement.

if amount is greater than 5000 then calculate discount and amount using the expressions discount = amount * 0.05 and amount = amount - discount.

print amount using printf statement.