0% found this document useful (0 votes)
37 views

Spring 2020 - Assignment CS101 - 3

This document provides instructions for Assignment #03 which requires students to create a bill calculator application for a restaurant. The application should allow customers to order items from a menu, calculate subtotals and tax, apply a discount if the pre-tax total is over 1000 rupees, and display the final bill amount. The document lists the menu items and their prices, and provides 5 steps for designing and coding the program to meet the requirements. A sample C++ solution is also provided.

Uploaded by

Zahra Usman
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Spring 2020 - Assignment CS101 - 3

This document provides instructions for Assignment #03 which requires students to create a bill calculator application for a restaurant. The application should allow customers to order items from a menu, calculate subtotals and tax, apply a discount if the pre-tax total is over 1000 rupees, and display the final bill amount. The document lists the menu items and their prices, and provides 5 steps for designing and coding the program to meet the requirements. A sample C++ solution is also provided.

Uploaded by

Zahra Usman
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Introduction to Computing (CS101) Total marks = 20

Assignment # 03 Deadline Date


05th of Aug 2020
Spring 2020

Question Statement 20 marks


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.

To design/code, please follow the stated steps:

1. Your program must show menu items on the program startup:


a) Pizza (Rs 999)
b) Burger (Rs 250)
c) Sandwich (Rs 150)
d) Paratha Roll (200)
2. Program must ask quantity for each item and calculate its total price.
3. Program will add 19% GST to the bill and Calculate total Bill.
4. Program will offer/give 5% discount if total bill is greater than 1000 Rs.
5. Show the payment along with all calculation (price, GST, discount) in proper format.

Solution
#include<iostream>
using namespace std;
main()
{
int item,p_qty=0,b_qty=0,s_qty=0,pr_qty=0;
int price_p=0,price_b=0,price_s=0,price_pr=0;
cout<<"\t\t**** Restaurant ****";
cout<<"\n\n\t\t\t *** Menu ***\n";
cout<<"\n\tPizza (Rs. 999)";
cout<<"\n\tBurger (Rs. 250)";
cout<<"\n\tSandwich (Rs. 150";
cout<<"\n\tParatha Roll (Rs. 200)";
cout<<"\n\n\tEnter quantity of Pizza : ";
cin>>p_qty;
cout<<"\tEnter quantity of Burger : ";
cin>>b_qty;
cout<<"\tEnter quantity of Sandwich : ";
cin>>s_qty;
cout<<"tEnter quantity of Paratha Roll : ";
cin>>pr_qty;
price_p = p_qty * 999;
price_b = b_qty * 250;
price_s = s_qty * 150;
price_pr = pr_qty * 200;
int bill= price_p+price_b+price_s+price_pr;

float gst= (float) bill*19/100;


float total = bill + gst;
float disc=0;
if(total>1000)
{
disc=total*5/100;
total=total-disc;
}
cout<<"\n\t**** Order Detail ****";
cout<<"\n\tPrice of "<<p_qty<<" Pizza : "<<price_p;
cout<<"\n\tPrice of "<<b_qty<<" Burger : "<<price_b;
cout<<"\n\tPrice of "<<s_qty<<" Sandwich : "<<price_s;
cout<<"\n\tPrice of "<<pr_qty<<" Paratha Roll : "<<price_pr;
cout<<"\n\tTotal Price of Items : "<<bill;
cout<<"\n\tAmount of GST : "<<gst;
cout<<"\n\tDiscount : "<<disc;
cout<<"\n\tPayable Amount : "<<total;
}

You might also like