Question: it should be written in Python 2.1. Write a class called RestaurantCheck. It should have the following: Fields called check_number, sales_tax_percent, subtotal, table_number, and server_name
it should be written in Python

2.1. Write a class called RestaurantCheck. It should have the following: Fields called check_number, sales_tax_percent, subtotal, table_number, and server_name representing an identification for the check, the bill without tax added, the sales tax percentage, the table number, and the name of the server. A constructor that sets the values of all four fields A method called calculate_total that takes no arguments (besides self) and returns the total bill including sales tax. A method called print_check that writes to a file called check###.txt, where ### is the check number and writes information about the check to that file, formatted like below: Check Number: 443 Sales tax: 6.0% Subtotal: $23.14 Total: $24.53 Table Number: 17 Server: Sonic the Hedgehog Test the class by creating a RestaurantCheck object and calling the print_check() method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
