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, 24.06.2019 11:00, maddiiie128
Why is it uncommon for users to perform searches directly in database tables? a.)users are discouraged from interacting directly with tables because they might confuse tables with spreadsheets. b.) users are discouraged from interacting directly with tables because this may result in unintended changes to source data. c.)users do not have the technical skills required to perform searches directly in database tables. d.)users do not have the permissions required to perform searches directly in database tables.
Answers: 1
image
Computers and Technology, 24.06.2019 16:30, magalya01
Which program can damage your computer?
Answers: 1
image
Computers and Technology, 25.06.2019 03:00, achewitt3965
What judgment would you make about open systems interconnect? not useful that it is a technology that it is a model that it does not pertain to technology
Answers: 1
image
Computers and Technology, 25.06.2019 05:30, genyjoannerubiera
In 3-5 sentences describe how technology business professionals to be more efficient. include examples of hardware and software
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, 18.09.2020 04:01
Konu
Mathematics, 18.09.2020 04:01
Konu
Mathematics, 18.09.2020 04:01
Konu
Mathematics, 18.09.2020 04:01
Konu
Mathematics, 18.09.2020 04:01
Konu
English, 18.09.2020 04:01
Konu
Mathematics, 18.09.2020 04:01
Konu
Mathematics, 18.09.2020 04:01
Konu
Mathematics, 18.09.2020 04:01
Konu
Mathematics, 18.09.2020 04:01