SAMPLE 001

Description:

Write a program to calculate the total expenses. Quantity and price per item are input by the user and discount of 20% is offered if the expense is more than 10000. Test Case 1 Input (stdin) 50 1000 Expected Output Total Expense is Rs. 40000 Test Case 2 Input (stdin) 10 1000 Expected Output Total Expense is Rs. 10000

Program :

#include<iostream>

using namespace std;



int main()

{

int totalexp, qty, price, discount;


//cout<<"Enter quantity:";

cin>>qty;

//cout<<"Enter price:";

cin>>price;


totalexp=qty*price;


if(totalexp>10000)

{

discount=(totalexp*0.2);

totalexp=totalexp-discount;

}

  else

  {

    totalexp =totalexp;

  }

   

cout<<"Total Expense is Rs. "<<totalexp;



return 0;

}