hello, i need help for my homework. Our instructor is so accurate with the homework so please, make sure to do the homework exactly as he wants. if there is something is missed , i will lose points. if you have any qeastions, let me know.
Programming Assignment 02
20 Points
Name
Due:
Wednesday, February 8, 2017
* Write a class named Pet, with should have the following data attributes:
name (for the name of a pet)
animalType ((for the type of animal that a pet is. Example, values are “Dog”, “Cat” and “Bird”)
age (for the pet’s age)
The Pet class should have an init method that creates these attributes. It should also have the
following methods:
setName – This method assigns a value to the __name field
setAnimalType – This method assigns a value to the _animalType field
setAge – This method assigns a value to the
getName – This method returns the value of the
name field
getAnimalType – This method returns the value of the _animalType field
getAge – This method returns the value of the __age field
age field
–
O
Once you have written the class, write a program that creates an object of the class and prompts the
user to enter the name, type and age of his or her pet. This should be stored as the object’s attributes.
Use the object’s accessor methods to retrieve the pet’s name, type and age and display this data on the
screen
Add the following comments to the beginning of the program.
Name:
Your Name
Class and Section: CS 222 01
Assignment:
Program Assignment 02
Due Date:
See above
Date Turned in:
Program Description:
You write a short description of what the program will do
When you complete the program, do the following.
1. Create a folder with the following name: ProgramAssignment02
2. Copy your program to this folder
3. Copy the folder to your folder in the I:\kopp\inbox\CS 222 01 folder
4. Print a copy of the source code and turn it in.
Extra Credit – 5 points
Add an str__method to the class that will print the attributes in a readable format. In the main part
of the program, create two more Pet objects, assign values to the attributes and print all three objects
using the print statement.