Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

Students also viewed these Databases questions

Question

Explain how concertive control evolves in an organization.

Answered: 1 week ago

Question

Is this public actively seeking information on this issue?

Answered: 1 week ago

Question

How much loyalty does this public have for your organization?

Answered: 1 week ago

Question

How influential does the organization see this public as being?

Answered: 1 week ago