Mr. Seth is a Goldsmith. He wants to know the amount of money earned from the sale.
On a Normal day, i.e., Weekday there is a sale of Rs. 10000/- which is fixed. On a weekend,
there is an additional sale of Rs. 5000/- , and on a festival day (be it either week day or week
end), there is an additional sale of Rs. 20000/-.
Following are requirements to solve the problem
a. The type of day i.e., weekend or festival day has to be captured.
b. Check for the type of day and compute the total amount of sale
c. Display the amount of sale in Rupees.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int sale, total_amt;
string day;
cout<<"Enter the day: ";
cin>>day;
if (day == "Monday", "Tuesday" ,"Wednesday", "Thursday", "Friday")
{
sale = 10000;
cout<<"Total Amount of sale on "<<day<<" is: "<<sale;
}
else if (day == "Saturday" or "Sunday")
{
sale = 10000;
total_amt = sale + 5000;
cout<<"Total Amount of sale on "<<day<<" is: "<<total_amt;
}
else if (day == "Festive Day" )
{
sale = 10000;
total_amt = sale + 20000;
cout<<"Total Amount of sale on "<<day<<" is: "<<total_amt;
}
return 0;
}
Comments
Leave a comment