0% found this document useful (0 votes)
4 views1 page

Python - Question - CIA III

The document outlines the requirements for creating a RestaurantBill class, which includes fields for restaurant details, a constructor, and methods for calculating totals and printing a formatted bill to a file. It specifies the necessary attributes such as restaurant name, location, bill number, and sales tax percentage, as well as methods for calculating the total bill and rounding. Additionally, it instructs to create a RestaurantBill object and test the print_check method.

Uploaded by

Dr. V. Elamaran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Python - Question - CIA III

The document outlines the requirements for creating a RestaurantBill class, which includes fields for restaurant details, a constructor, and methods for calculating totals and printing a formatted bill to a file. It specifies the necessary attributes such as restaurant name, location, bill number, and sales tax percentage, as well as methods for calculating the total bill and rounding. Additionally, it instructs to create a RestaurantBill object and test the print_check method.

Uploaded by

Dr. V. Elamaran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Question:

Create a RestaurantBill class. It must have the following:

i) restaurant_name, restaurant_location, bill_number, gst_percent, subtotal,


table_number, and server_name are fields that reflect the restaurant name,
restaurant location, the bill identification, the sales tax percentage, the bill
without tax, the table number, and the server's name.

ii) A constructor that sets the values of all seven fields

iii) A method called calculate_total that takes no arguments (besides self)


and returns the total bill including sales tax.

iv) A method called total_after_rounding that takes no arguments (besides


self) and returns the total after rounding.

iv) A method called print_check that writes to a file called billl###.txt, where
### is the bill number and writes information about the bill to that file,
formatted like below:

Restaurant Name: Ashok Bhavan

Restaurant Location: Bangalore

Bill Number: 47

Sales (GST) tax: 18%

Subtotal: Rs.865

Total: Rs.1020.7

Total (after rounding): Rs.1021

Table Number: 16

Server: Mahesh

Create a RestaurantBill object and use the print_check( ) method to test the
class.

You might also like