Here is the pseudocode: //import IO and Scanner classes class PetProgram{ //Decl
ID: 3636189 • Letter: H
Question
Here is the pseudocode://import IO and Scanner classes
class PetProgram{
//Declare a Pet variable
public static void main() {
//Create a PetProgram object
//Create Scanner object
//Declare a String for the name, a String for the type, and an int for the age of the pet. (these values can also be global variables, but they make more sense as local vars)
// Initialize the Pet variable
//Print a statement to the screen asking the user to input the name, type, and age of pet
//Use Scanner object to read in the name String and store it in the name var.
//Use Scanner object to read in the type String and store it in the type var.
//Use Scanner object to read in the age int and store it in the age var.
//Use setName() mutator to give the pet the name that the user has entered
//Use setType()
//Use setAge()
//Use a print statement and getName(), getType(), and getAge() to display the pet’s info to the user.
return;
}
}
Class Pet {
//Declare a String for the name, a String for the type, and an int for the age of the pet.
public void Pet(String newName, String newType, int newAge) { //it’s good programming practice to give these variables different names than the global values
//name = newName
//type = newType
//age = newAge
return
}
public void setName(String newName){
//name = newName
}
public void setType(String newType){
//type = newType
}
public void setAge(int newAge){
//age = newAge
}
public String getName(){
//return name
}
public String getType(){
//return type
}
public int getAge(){
//return age
}
}
}
Explanation / Answer
Hi I have done the solution for this in my notebook. But the solution is too big , I cannot type it here because very less time is remaining.. So please rate me Lifesaver and I'll share the answer with you through email or cramster inbox. I don't do this generally, but I have no other option here because there's very less time left... you need not worry as I have the solution ready