subject

Write a python class named Pet, which should have the following data attributes: __name(for the name of a pet)
__animal_type(for the type of animal that a pet is. Example values are 'Dog','Cat', and 'Bird')
__age(for the pets age)

The Pet class should have an __init__ method that creates these attributes. It should also have the following methods:

set_name This method assigns a value to the __name field
set_animal_type This method assigns a value to the __animal_type field
set_age This method assignsa value to the __age field
get_name This method assignsa value to the __name field
get_animal_type This method assignsa value to the __animal_type field
get_age This method assignsa value to the __age field

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 data should be stored as the objects attributes. Use the objects accessor methods to retrieve the pets name, type, and age and display this data on the screen.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:00
Sam is a data analyst at an advertising firm. he often uses a spreadsheet that contains media ratings details. he would like to filter the spreadsheet data based on different filter criteria. which operators can he use to specify the combination of filter criteria? sam can use the ( blank ) operators to specify a combination of filter criteria.
Answers: 3
question
Computers and Technology, 22.06.2019 11:30
Hassan is writing his master’s thesis, which is a thirty-page document. he received some feedback from his professor in the form of comments, but does not see where the comments are. what is the fastest way for hassan to find the feedback?
Answers: 3
question
Computers and Technology, 23.06.2019 18:50
What is transmission control protocol/internet protocol (tcp/ip)? software that prevents direct communication between a sending and receiving computer and is used to monitor packets for security reasons a standard that specifies the format of data as well as the rules to be followed during transmission a simple network protocol that allows the transfer of files between two computers on the internet a standard internet protocol that provides the technical foundation for the public internet as well as for large numbers of private networks
Answers: 2
question
Computers and Technology, 24.06.2019 12:30
Nikki sent flyers in the mail to all houses within the city limits promoting her computer repair service what type of promotion is this and example of
Answers: 1
You know the right answer?
Write a python class named Pet, which should have the following data attributes: __name(for the nam...
Questions
question
Mathematics, 17.09.2021 08:40
question
Chemistry, 17.09.2021 08:40
question
Mathematics, 17.09.2021 08:40
question
Biology, 17.09.2021 08:40
question
Mathematics, 17.09.2021 08:40
Questions on the website: 13722360