Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need help with this in python LZS ddily Hp/PAUN 3.6 Program: Pets! In this lab, you will be writing a program with classes to keep

need help with this in python
image text in transcribed
image text in transcribed
LZS ddily Hp/PAUN 3.6 Program: Pets! In this lab, you will be writing a program with classes to keep track of pets. (3 pts) Create a new class called Pet in a file called pet.py. Create a class attribute for the owner's name (called "pet_owner). Since all good pets deserve a name and and have an age, your class should take the name and age from the constructor and assign them to instance variables. Your constructor should take parameters in the following order, name, age. Your instance variables should be called pet name petage (2 pts) Override the print method to output a human-friendly version of the object/pet information Example Output Sadie is 6 year(s) old and is owned by Fred (3 pts) in a file main py, write a main function to test your pet class. The main function should prompt the user for an owner name and then prompt for the names and ages for all pets until the user enters a gor Q. After the entry print out a list of all the pets Example Output re to search My library > CSC 145: Intermediate Programming home 53.6: Program Pels! SU Dampie output Sadie is 6 year(s) old and is owned by Fred (3 pts) in a file main.py, write a main function to test your Pet class. The main function should prompt the user for an owner name and then prompt for the names and ages for all pets until the user enters a'd' or 'Q. After the entry print out a list of all the pets. Example Output Please enter the puner's name: Steve M. Please enter the pet's name: Fido Please enter the pet's age: 7 Please enter the pet's name: Spot Please enter the pet's age: 1 please enter the pet's name: Rover Please enter the pet's age: 12 Pot List: Pido is 7 year(s) old and is owned by Steve M. Spot is 1 year(s) old and is owned by Steve M. Rover is 12 years old and is owned by Steve M. ACTIVITY 3.6.1 Program Pets! 018 Current file: main.py Load default template here to search

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 11G SQL

Authors: Joan Casteel

2nd Edition

1133947360, 978-1133947363

More Books

Students also viewed these Databases questions

Question

=+ Where would most corporations like the balance to fall?

Answered: 1 week ago