Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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() methodStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started