Answer to Question #173807 in C for R SWASTHIK

Question #173807


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



1
Expert's answer
2021-03-20T14:30:06-0400
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS