Answer:
The program in C++ is as follows:
#include <iostream>
using namespace std;
int main(){
int qty;
float discount = 0;
cout<<"Quantity: ";
cin>>qty;
int cost = qty * 100;
[tex]i f (cost > 1000)[/tex] { [tex]discount=cost * 0.10[/tex]; }
cout<<"Cost: "<<cost - discount;
return 0;
}
Explanation:
This declares the quantity as integer
int qty;
This declares and initializes discount to 0
float discount = 0;
This prompts the user for quantity
cout<<"Quantity: ";
This gets input for quantity
cin>>qty;
This calculates the cost
int cost = qty * 100;
If cost is above 1000, a discount of 10% is calculated
[tex]i f (cost > 1000)[/tex] { [tex]discount=cost * 0.10[/tex]; }
This prints the cost
cout<<"Cost: "<<cost - discount;