1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#include <iostream>
using namespace std;
int main()
{
cout<<"please enter the number of units sold in this current transaction\n";
float units, total;
cin>>units;
if (units)
{
if(units<10)
total=units*99;
if(units >= 10 && units < 20) {
total=((units*99)-((units*99)*(0.20)));
}
else if(units >= 20 && units <50) {
total=((units*99)-((units*99)*(0.30)));
}
else if(units >= 50 && units < 100) {
total=((units*99)-((units*99)*(0.40)));
}
else if(units >= 100) {
total=((units*99)-((units*99)*(0.50)));
}
else {
cout<<"enter a correct value please";
}
}
cout<<total<<"\n";
}
|