Accept the marked price from the user and calculate the Net amount as(Marked Price – Discount) to pay according to following criteria:
Marked Price - Discount
>10000 20%
>7000 and <=10000 15%
<=7000 10%
#include <iostream>
using namespace std;
int main() {
float markedPrice;
float netAmount;
float discount;
cout<<"Enter the marked price: ";
cin>>markedPrice;
//>10000 20%
//>7000 and <=10000 15%
//<=7000 10%
if(markedPrice>10000){
discount=0.2*markedPrice;
}
if(markedPrice>7000 && markedPrice<=10000){
discount=0.15*markedPrice;
}
if(markedPrice<=7000){
discount=0.1*markedPrice;
}
netAmount=markedPrice-discount;
cout<<"The Net amount: "<<netAmount<<"\n";
system("pause");
return 0;
}
Comments
Leave a comment