Computers and Technology

Design a class named Pet, which should have the following fields:name: The name field holds the name of a pet.type: The type field holds the type of animal that a pet is. Example values are"Dog", "Cat", and "Bird".age: The age field holds the pet’s age. The Pet class should also have the following methods:setName: The setName method stores a value in the name field.setType: The setType method stores a value in the type field.setAge: The setAge method stores a value in the age field.getName: The getName method returns the value of the name field.getType: The getType method returns the value of the type field.getAge: The getAge method returns the value of the age field. Once you have designed the class, design a program that creates an object of theclass and prompts the user to enter the name, type, and age of his or her pet. This Data should be stored in the object. Use the object’s accessor methods to retrieve the cat’s name, type, and age and display this data on the screen.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 14:30, camerondillonn
If the polar bear were taken out of the food chain what would happen to the seal population the seal population would diminish the seal population would grow dramatically the seal population would stay the same the seal population would decrease slightly
Answers: 1
image
Computers and Technology, 22.06.2019 20:00, bartlettcs9817
Which location-sharing service offers items for users as a gaming component and also allows them to collectively link their check-ins to publish a trip? a. whrrl b. buzzd c. foursquare (this option is wrong i already tried) d. gowalla for plato
Answers: 2
image
Computers and Technology, 23.06.2019 09:30, kreshnikolloma
You wanted to look up information about alzheimer's, but you were unsure if it was spelled "alsheimer's" or "alzheimer's." which advanced search strategy would be useful? a) a boolean search b) using a wild card in your search c) trying different search engines d) doing a search for "alsheimer's not alzheimer's" asap. ill give brainlist.
Answers: 1
image
Computers and Technology, 23.06.2019 21:20, nathanfletcher
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
Do you know the correct answer?
Design a class named Pet, which should have the following fields:name: The name field holds the nam...

Questions in other subjects:

Konu
Mathematics, 10.12.2020 23:30
Konu
Mathematics, 10.12.2020 23:30
Konu
Mathematics, 10.12.2020 23:30
Konu
Arts, 10.12.2020 23:30