#include <iostream.h>
int main()
{
int price;
cout << "Please enter meal price? "; // Printing the meal price message to get value
cin >> price; // getting the value from user
float saleTax;
if(price<=100)
{
saleTax = 0.0 * price;
}
else if(price <= 200)
{
saleTax = 0.1 * price;
}
else
{
saleTax = 0.2 * price;
}
int totalAmount;
totalAmount = price + saleTax; // adding Price and Sale Tax
cout << "The total price of Meal is = " << totalAmount << endl;
getch();
}
No comments:
Post a Comment
“You can't change the past, but you can ruin the present by worrying about the future”