Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A + Computer Science - Writing Classes Worksheet 2 DIRECTIONS : Fill in each blank with the proper java code. class Pet { private String
A Computer Science Writing Classes Worksheet
DIRECTIONS : Fill in each blank with the proper java code.
class Pet
private String name;
private int age;
public PetString int a
i
public void setAge int a
public void setName String n
q
public String getName
q
public int getAge
q
public string tostring
runner code
Scanner kb new Scanner Systemin;
for int r; r; r
System.out.print Enter a pet name ::;
String n kbnext;
System.out.print Enter a pet age ::;
String n kbnextInt;
Pet pet new Pet n a ;
System.out.println pet;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started