Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a program to store the class pet into a list of three values. Program Nam

ID: 3831538 • Letter: C

Question

Create a program to store the class pet into a list of three values.

Program Names: Assign11_ Pet_List_First_Last.py for the program that tests the Pet class Assign10_Pet_First_Last.py which contains the Pet class (This is from your Assignment 10):

# The CellPhone class holds data about a cell phone.

class Pet:

# The __init__ method initializes the attributes.
  
def __init__(self, name, an_type, age):
self.__name = name
self.__animal_type = an_type
self.__age = age

# The set_name method accepts an argument for
# the animals name.

def set_name(self, name):
self.__name = name

# The set_animal_type method accepts an argument for
# the animal type.

def set_animal_type(self, model):
self.__animal_type = an_type

# The set_age method accepts an argument
# for the age of pet.

def set_age(self, age):
self.__age = age

# The get_name method returns the
# animals name.

def get_name(self):
return self.__name

# The get_animal_type method returns the
# animals type.

def get_animal_type(self):
return self.__animal_type

# The get_age method returns the
# animals age.

def get_age(self):
return self.__age

Due Date: May 2, 2017 Points: 30

Input files: None Description: You create a program to store Pet objects in a list.

1. You will be modifying the cell_phone_list.py program on pp. 446 – 447 in the book. You will use your Pet class and create a list with only 3 pets, not five. Save as: Assign11_ Pet_List_First_Last.py

2. Start the Assign11_ Pet_List_First_Last.py program with at least five comments. The top three should be: # CIS115.600 Assignment 11 # First Last (Where First is your first name and Last is your last name) #Current Date

3. You will be using your Pet class from Assignment 10. Do not change this object!!! Be sure this file is in the same directory as your Assign11_ Pet_List_First_Last.py file.

4. Note that you will have to import: Assign10_Pet_First_Last instead of cellphone and you will have to use this name when you create an instance of the class.

5. Make sure your variable names AND COMMENTS are descriptive.

6. Test and save. I will not grade any program that does not run. Submit BOTH .py files via Blackboard.

python code please.

I have this so far but it doesnt run:

# This program creates five CellPhone objects and
# stores them in a list.

import Assign10_Pet_Zak_Klomhaus
def main():
# Get a list of CellPhone objects.
Assign10_Pet_Zak_Klomhaus = make_list()

# Display the data in the list.
print('Here is the data you entered:')
display_list(Assign10_Pet_Zak_Klomhaus)

# The make_list function gets data from the user
# for five phones. The function returns a list
# of CellPhone objects containing the data.

def make_list():
# Create an empty list.
Assign10_Pet_Zak_Klomhaus_list = []

# Add five CellPhone objects to the list.
print('Enter data for three animals.')
for count in range(1, 4):
# Get the phone data.
print('animal number ' + str(count) + ':')
animal_type= input('Enter animal type, possible entries:Dog, cat and bird')
name = input('Enter animals name.')
age = int(input("Enter the animals age ")

# Create a new CellPhone object in memory and
# assign it to the phone variable.
Assign10_Pet_zak_Klomhaus = Assign10_Pet_zak_Klomhaus.CellPhone(animal, name, age)

# Add the object to the list.
phone_list.append(phone)

# Return the list.
return phone_list

# The display_list function accepts a list containing
# CellPhone objects as an argument and displays the
# data stored in each object.

def display_list(phone_list):
for item in phone_list:
print(item.get_manufact())
print(item.get_model())
print(item.get_retail_price())
print()

# Call the main function.
main()

Explanation / Answer

methods

pet class

tester

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote