Write a program that creates a class named Person with three instance attributes: name, address, and cell_number as stri

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Write a program that creates a class named Person with three instance attributes: name, address, and cell_number as stri

Post by answerhappygod »

Write a program that creates a class named Person with threeinstance attributes: name, address, and cell_number as strings.Next, create a class named Customer (subclass) that inherits fromthe Person class. The Customer class should have two additionalinstance attributes: customer_number as a string, on_mailing_listas a boolean. Each class should include __init__() and __str__()methods. The Customer class __init__() and __str__() methods mustmake a call to super() to access the Person's methods. After theCustomer class code, prompt the user to enter a name, address andcell_number for a person. Instantiate a Person object by passing inthe user's input as the arguments and print out the Person'sattributes by calling the __str__() method. Next, prompt the userto enter a name, address, cell_number, customer_number andon_mailing_list for a customer. Instantiate a Customer object bypassing in the user's input as the arguments and print out theCustomer's attributes by calling the __str__() method. No promptingfor input should be included in the Person or Customer class. Hereis a
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply