Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help rewriting python codes. PYTHON 3 ONLY please :) Instructions below. Codes to be revised are also provided in screenshots below. Python 3 only.

Need help rewriting python codes. PYTHON 3 ONLY please :)

Instructions below.

Codes to be revised are also provided in screenshots below. Python 3 only. Thank you!

image text in transcribed

image text in transcribed

LAB13.PY

image text in transcribed

LAB13_TEST1

image text in transcribed

PETS.PY

image text in transcribed

image text in transcribed

THANK YOU SO MUCH!

Lab Exercises Microsoft Word lab1 3.docx https://www.ese msu.edu/-es https://www.ese msu.edu es https://www.c se.msu.edu-es Bobby x Secure https://www.cse.msu.edufcse231/Online/Labs/Lab13/lab13.pdf Apps For quick access, place your bookmarks here on the bookmarks bar. Import bookmarks now Microsoft Word-lab13.docx 1/2 2. Examine the file named "pets.py", which contains an outline of four classes to support the handling of pets within Python programs. You will Please note that class PetError" is a subclass of class "Exception" and is complete as-is. complete the remaining three classes as described below Class "Pet" (which is a subclass of class "Object") should include the following methods: Accepts three arguments: self, species (default None), and name (default ""). Stores species and name as data attributes. Raises PetError, if species is not one of the following (case insensitive): 'dog', 'cat, 'horse, gerbil', hamster, 'ferret nit Returns a string which depends on whether the pet is named or not. if named: "Species of: Xxx, named Yyy", where Xxx is the species data attribute and Yyy is the name data attribute, both in "title-case" (first letter upper case and rest lower casc hint: titlc) otherwise: "Species of: Xxx, unnamed". where Xxx is the species data attribute in "title-case" Class"Dog" (which is a subclass of class Pet") should include the following methods: init Accepts three arguments: self, name (default, and chases (default "Cats"). Uses the constructor for class "Pet" to store species ("Dog") and name as data attributes. Stores chases as a data attribute. Hint: check out how MassParticle calls the Particle initin Code Listing 12.11 Returns a string which depends on whether the dog is named or not. Hint: call the Pet class' _str_ (scc MassParticlc's_str_in Code Listing 12.11) str if named: "Species of Dog, named Yyy, chases zzz", where Yyy is the name data attribute (as above) and zzz is the chases data attribute. otherwise: "Species of: Dog, unnamed, chases zzz". where zzz is the chases data attribute. Lab Exercises Microsoft Word lab1 3.docx https://www.ese msu.edu/-es https://www.ese msu.edu es https://www.c se.msu.edu-es Bobby x Secure https://www.cse.msu.edufcse231/Online/Labs/Lab13/lab13.pdf Apps For quick access, place your bookmarks here on the bookmarks bar. Import bookmarks now Microsoft Word-lab13.docx 1/2 2. Examine the file named "pets.py", which contains an outline of four classes to support the handling of pets within Python programs. You will Please note that class PetError" is a subclass of class "Exception" and is complete as-is. complete the remaining three classes as described below Class "Pet" (which is a subclass of class "Object") should include the following methods: Accepts three arguments: self, species (default None), and name (default ""). Stores species and name as data attributes. Raises PetError, if species is not one of the following (case insensitive): 'dog', 'cat, 'horse, gerbil', hamster, 'ferret nit Returns a string which depends on whether the pet is named or not. if named: "Species of: Xxx, named Yyy", where Xxx is the species data attribute and Yyy is the name data attribute, both in "title-case" (first letter upper case and rest lower casc hint: titlc) otherwise: "Species of: Xxx, unnamed". where Xxx is the species data attribute in "title-case" Class"Dog" (which is a subclass of class Pet") should include the following methods: init Accepts three arguments: self, name (default, and chases (default "Cats"). Uses the constructor for class "Pet" to store species ("Dog") and name as data attributes. Stores chases as a data attribute. Hint: check out how MassParticle calls the Particle initin Code Listing 12.11 Returns a string which depends on whether the dog is named or not. Hint: call the Pet class' _str_ (scc MassParticlc's_str_in Code Listing 12.11) str if named: "Species of Dog, named Yyy, chases zzz", where Yyy is the name data attribute (as above) and zzz is the chases data attribute. otherwise: "Species of: Dog, unnamed, chases zzz". where zzz is the chases data attribute

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

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students also viewed these Databases questions

Question

Sketch the Bode magnitude and phase plots of: H(j) = 50/ j (5 + j)

Answered: 1 week ago

Question

Discuss the role of PO fit in explaining turnover intention.

Answered: 1 week ago