Flipkart is providing a discount to customers based on the purchases made. Ramachandra has
purchased some items, he would like to know his bill. Following are the requirements to solve
the problem
a) For purchases less than Rs 1000 , the discount is 10%
b) For purchases greater than and equal to Rs 1000 and less than 1500
the discount is 12%
c) For purchases greater than and equal to Rs 1500 the discount is 14%
d) Capture the purchased amount by Ramachandra
e) Display Ramachandra’s final bill
#include <bits/stdc++.h>
using namespace std;
int main()
{
int purchase,bill;
cout<<"Enter your Purchase Amount: ";
cin>>purchase;
if (purchase < 1000)
{
bill = purchase - (purchase * 0.1);
cout<<"Your Bill is: "<<bill;
}
else if (purchase >= 1000 and purchase < 1500)
{
bill = purchase - (purchase * 0.12);
cout<<"Your Bill is: "<<bill;
}
else if (purchase >= 1500)
{
bill = purchase - (purchase * 0.14);
cout<<"Your Bill is: "<<bill;
}
return 0;
}
Comments
Leave a comment