Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You just do 9.6,9.7,9.8,9.9.. implement these using python a ert Q&A Implement these using python Done TRY IT YOURSELF 9-1. Restaurant: Make a class called
You just do 9.6,9.7,9.8,9.9.. implement these using python
a ert Q&A Implement these using python Done TRY IT YOURSELF 9-1. Restaurant: Make a class called Restaurant. The_init) method for Restaurant should store two attributes: a restaurant name and a cuisine type. Make a method called describe restaurant() that prints these two pieces of information, and a method called open restaurant() that prints a message indi- cating that the restaurant is open. Make an instance called restaurant from your class. Print the two attri butes individually, and then call both methods. 9-2. Three Restaurants: Start with your class from Exercise 9.1. Create three different instances from the class, and call describe_restaurant() for each instance 9-3. Users: Make a class called User. Create two attributes called first name and last name, and then create several other attributes that are typically stored in a user profile. Make a method called describe, user() that prints a summary of the user's information. Make another method called greet,user() that prints a personalized greeting to the user Create several instances representing different users, and call both methods for each user TRY IT YOURSELF 9-4. Number Served:Stort with your progrom from Exercise 9.1 (page 166) Add an attribute called number served with a default value of 0. Createn instance called restaurant from this class. Print the number of customers the restaurant has served, and then change this value and print i again Add a method called set number served() that lets you set the number of customers that have been served. Call this method with a new number and print the value again Add a method called increnent number-served()!hat lets you increment the number of customers who've been served. Call this method with any num ber you like that could represent how many customers were served in, say.a day of business 9-5. Login Attempts: Add bn aftribute called login attempts to your User class from Exercise 9.3 (page 166).Write a method called increment login attempts( that increments the value of login attespts by 1. Write another method called reset login attempts() that resets the volue of login attempts to O. Make an instance of the User class and call increment login attenpts() several times. Print the value of login attempts to make sure it was incremented properly, and then call reset login attempts() Print login attempts again to make sure it was reset to O. a ert Q&A Implement these using python Done TRY IT YOURSELF 9-1. Restaurant: Make a class called Restaurant. The_init) method for Restaurant should store two attributes: a restaurant name and a cuisine type. Make a method called describe restaurant() that prints these two pieces of information, and a method called open restaurant() that prints a message indi- cating that the restaurant is open. Make an instance called restaurant from your class. Print the two attri butes individually, and then call both methods. 9-2. Three Restaurants: Start with your class from Exercise 9.1. Create three different instances from the class, and call describe_restaurant() for each instance 9-3. Users: Make a class called User. Create two attributes called first name and last name, and then create several other attributes that are typically stored in a user profile. Make a method called describe, user() that prints a summary of the user's information. Make another method called greet,user() that prints a personalized greeting to the user Create several instances representing different users, and call both methods for each user TRY IT YOURSELF 9-4. Number Served:Stort with your progrom from Exercise 9.1 (page 166) Add an attribute called number served with a default value of 0. Createn instance called restaurant from this class. Print the number of customers the restaurant has served, and then change this value and print i again Add a method called set number served() that lets you set the number of customers that have been served. Call this method with a new number and print the value again Add a method called increnent number-served()!hat lets you increment the number of customers who've been served. Call this method with any num ber you like that could represent how many customers were served in, say.a day of business 9-5. Login Attempts: Add bn aftribute called login attempts to your User class from Exercise 9.3 (page 166).Write a method called increment login attempts( that increments the value of login attespts by 1. Write another method called reset login attempts() that resets the volue of login attempts to O. Make an instance of the User class and call increment login attenpts() several times. Print the value of login attempts to make sure it was incremented properly, and then call reset login attempts() Print login attempts again to make sure it was reset to O
Step 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