The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 4 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Using NetBeans as java program.
Design a class named pet, which should have the following fields:
   * name. The name field holds the name of a pet.
   * animal. The animal field holds the type of animal that a pet is.      Example values are "Dog","Cat",and "Brid".
   * 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 field.
   * setAnimal. The setAnimal method stores a value in the animal field.
   * setAge. The setAge method stores value in the age field.
   * getName. The getName method returns the value of the name field.
   * getAnimal. The getAnimal method returns the value of the animal 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 the class
Pet
and prompt the
user to enter (in a descriptive/user-friendly way
1
) the name, type, age, and weight of his or her pet
. This data
should be stored in the object. Use the objectA????1s ac
cessor methods to retrieve the data from the object
(the
petA????1s name, type, age, and weight) and confirm it (
display in on the screen, in a user-friendly way).
The
program/project
should be called
[YourName]-Assignment3
(replace [YourName] with your actual name)
and the class file should be called
Pet.java
. You will need to add the class
Pet
to the project and add your code
to the project class
main
method.
Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â----------- Th-----------ank----------- Yo-----------u f-----------or -----------usi-----------ng -----------our----------- we-----------bsi-----------te -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill-----------