Question: A + Computer Science - Writing Classes Worksheet 1 DIRECTIONS : Fill in each blank with the proper Java code. class Alligator { private int

A+ Computer Science - Writing Classes Worksheet 1
DIRECTIONS : Fill in each blank with the proper Java code.
class Alligator
{
private int length;
private double hunger;
public Alligator()
q
}
public Alligator(int len, double hun)
i
}
??? returns true if hunger >50
??? returns false if hunger 50
public boolean istungry()
{
}
public string tostring()
q
}
}
????????????????????????????????????????
??? runner code in another class
Alligator gator = new Alligator();
Alligator gatuh = new Alligator (3,76);
Alligator mean = new Alligator (55,24);
out.println ("gator ="+ gator);
out.println("gator hungry ="+ gator.isHungry());
out.println ("gatuh ="+ gatuh);
out.println("gatuh hungry =+ gatuh.isHungry());
out.println ("mean ="+ mean);
out.println("mean hungry =+ mean.isHungry());
OUTPUT
gator =0.0
gator hungry =
false
gatuh =376.0
gatuh hungry =
true
mean =5524.0
mean hungry =
false
 A+ Computer Science - Writing Classes Worksheet 1 DIRECTIONS : Fill

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!