A restaurant wants a program that allows its salesclerks to enter the number of bagels, donuts, and cups of coffee a customer orders. Bagels are Rs. 99, donuts are Rs.75, and coffee is Rs. 120 per cup. The program should calculate and display the total price of the customer’s order.
/*
A restaurant wants a program that allows its salesclerks to enter the number of bagels, donuts, and cups
of coffee a customer orders. Bagels are Rs. 99, donuts are Rs.75, and coffee is Rs. 120 per cup. The program should
calculate and display the total price of the customer’s order.
*/
#include <iostream>
using namespace std;
int main()
{
int no_bagels;
int no_donuts;
int no_cups;
//get input from the user
cout<<"\nEnter number of bagels: ";
cin>>no_bagels;
cout<<"\nEnter number of donuts: ";
cin>>no_donuts;
cout<<"\nEnter number of cups: ";
cin>>no_cups;
//calculate the total price of the customer’s order
int total=((no_bagels*99)+(no_donuts*75)+(no_cups*120));
//display the total price of the customer’s order
cout<<"\nTotal Price = Rs. "<<total;
return 0;
}
Sample Output
Comments
Leave a comment