Introduction To Computing (CS101) : Assignment # 03
Introduction To Computing (CS101) : Assignment # 03
You are required to make a bill calculator application for a fast food restaurant. The restaurant
offers some foods, that can be ordered by customers. Customer can order any number of items.
You should design a program to calculate bill accordingly.
Program should add 19% GST to the stated order by your customer. If the customer’s bill is
greater than 1000 rupees, the restaurant will give 5% discount on complete calculated bill.
You program must show the complete order details along with GST calculations, Discount (if
applicable) and final amount.
Answer:
#include <iostream>
#include <ctime>
#include <cstdlib>
int main()
{
//Declaring variables
int Num_pizza,Num_burger,Num_sandwich,Num_paratha;
float gst,discount,total,net_total,order_amount;
//Displaying menu
cout<<"a) Pizza (Rs 999)\nb) Burger (Rs 250)\nc) Sandwich (Rs 150)\nd) Paratha Roll (Rs
200)\n";
//Taking input quantity of items
cout<<"Enter quantity of Pizza: ";
cin>>Num_pizza;
cout<<"Enter quantity of Burger: ";
cin>>Num_burger;
cout<<"Enter quantity of Sandwich: ";
cin>>Num_sandwich;
cout<<"Enter quantity of Paratha Roll: ";
cin>>Num_paratha;
//Calculating total
order_amount = (999 * Num_pizza) + (250 * Num_burger) + (150 * Num_sandwich) + (200 *
Num_paratha);
//Calculating gst
gst = 0.19 * order_amount;
//Calculating total
total = order_amount + gst;
//Calculating discount
if (total > 1000)
discount = 0.05 * total;
else
discount = 0;
//Calculating net total
net_total = total - discount;