[Solved] METCSS521 Homework6

$25

File Name: METCSS521_Homework6.zip
File Size: 178.98 KB

SKU: [Solved] METCSS521 Homework6 Category: Tag:
5/5 - (1 vote)

In this assignment, you will be demonstrating your understanding and use of python classes and inheritance and polymorphism, as covered in module 6.

Assignment Background

This assignment makes use of inheritance to create a set of related classes. At the end, you will have a more complex structure of parent-child classes than you saw in the modules examples.

Assignment Statement

  • You will create the following classes using inheritance:

o A base class called Pet o A mix-in class called Jumper o A Dog class and a Cat class that each inherit from Pet and Jumper o Two classes that inherit from Dog: BigDog and SmallDog o One classes that inherit from Cat: HouseCat

  • The general skeleton of the Pet, Dog, and BigDog classes will be given to you, but you will have to identify the required inheritance for a class. You will be responsible for writing the functionality of those classes and their methods.
  • A description of each classs functionality, as well as the data to use, is in the requirements below.
  • You will be required to write the code to exercise your classes per the requirements.

Requirements

Use the provided template to complete the following. The details are in the skeleton file.

  1. The Pet class:
    1. Assign values to two variables: kind and color
    2. Implement the constructor to initialize the pets name
    3. Implement __str__ method per skeleton
    4. Implement do_tricks method per skeleton
  2. The Jumper class
    1. Implement the jump method per the skeleton
  3. The Dog class
    1. Decide which classes to inherit from and implement inheritance
    2. Change the kind to canine
    3. Implement __str__ per skeleton
    4. Implement __call__ per skeleton
  4. The BigDog class
    1. Change the color to tan
    2. Implement __str__ per skeleton
    3. Implement speak per skeleton
  5. The SmallDog class
    1. Change the color to brindle
    2. Implement __str__ per skeleton
    3. Implement speak per skeleton
  6. The Cat class
    1. Change the kind to feline
    2. Implement __str__ per skeleton
    3. Implement speak per skeleton
    4. Implement climb per skeleton
  7. The HouseCat class
    1. Change the color to white
    2. Implement __str__ per skeleton
    3. Implement speak per skeleton
  8. Create the code to exercise the class structure according to the following:
    1. Instantiate each class(except Jumper)
    2. Create a list of the instantiated objects
    3. Loop through the objects
    4. For each object:
      1. Print __str__
      2. print the kind of pet
  • Print the Color of the pet
  1. Have the pet do tricks
  2. if applicable, print rollover action and the owners name
  3. If applicable, have the pet climb vii. To separate each pet, print a line of underscores or dashes

Sample Output

Your output should look something like this and should be in this order:

I am a brown animal named Rover animal brown

Rover is doing tricks

– I am a cat named Lion

feline

brown

Lion is doing tricks Lion says Meow!!!

Lion is jumping

Lion is climbing the curtains again note climbing action is for Cats

I am a dog named Roo

canine brown

Roo is doing tricks

Roo is jumping

Roo is rolling over note rollover and owner actions are for Dogs

My owner is George

– Noah is a large, muscular dog canine tan

Noah is doing tricks Noah says Woof!!! Noah is jumping

Noah is rolling over

My owner is George

– Lucky is a tiny, cute dog canine brindle

Lucky is doing tricks Lucky says Yip!

Lucky is jumping

Lucky is rolling over

My owner is George

– Zebra is a cat with fluffy, white fur feline white

Zebra is doing tricks

Zebra says Purr

Zebra is jumping

Zebra is climbing the curtains again

Process finished with exit code 0

What to Deliver

You are required to supply a single file emailID_hw6.py (example: marc10is_hw6.py)

Notes

  • Start by identifying and ordering the objectives.
  • Look at the skeleton there is a lot of guidance in it. The amount you need to code is smaller than in our other assignments. We want to make sure that you see how the different classes work together to show inheritance and polymorphism. This would be way too big an assignment without the skeleton.
  • The exercising your pet portion of this tests all the methods and classes created in this assignment. Your output should match the order of the sample output provided. You can get creative for instance, instead of My owner is George, feel free to say something along the lines of My owner, George, is the BEST owner in the whole world But it should all still print in the order below.
  • A 25-point deduction for one day late. After 1 day late, a 0 will be given.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] METCSS521 Homework6
$25