Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A+ Computer Science ANGRY BEAR Lab Goal : This lab was designed to teach you more about decision making and classes. Lab Description : Files
A+ Computer Science ANGRY BEAR Lab Goal : This lab was designed to teach you more about decision making and classes. Lab Description : Files Needed :: For this problem, you need to make an AngryBear class. AngryBear . java AngryBearRunner . java The AngryBear class must have 2 instance variables. The first instance variable will store the days the bear has been awake. The second instance variable will store the number of teeth for the bear. The AngryBear class will have 1 constructor that takes in values for days awake and number of teeth. The AngryBear class will have one method isAngry(; An AngryBear is angry if it has been awake for more than 3 days and has less than 10 teeth. An AngryBear is angry it if has no teeth. An AngryBear is angry if it has been awake for more than 5 days. Otherwise, the AngryBear is not really angry, but he could be quite annoyed. Runner Code : AngryBear a = new AngryBear ( 10, 3 ) ; System. out . println ( a. isAngry ( ) ) ; AngryBear b = new AngryBear ( 10, 35 ) ; System. out. printIn ( b. isAngry( ) ) ; AngryBear c = new AngryBear ( 1, 25 ) ; System. out . printIn ( c. isAngry () ) ; AngryBear d = new AngryBear ( 6, 40 ) ; System. out . printIn ( d. isAngry ( ) ) ; AngryBear e = new AngryBear ( 1, 1 ) ; System. out . printIn ( e. isAngry () ) ; AngryBear f = new AngryBear ( 111, 111 ) ; System. out . printIn ( f. isAngry() ) ; Sample Output : true true false true false true A+ Computer Science - classes - www.apluscompsci.com
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