Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSE-1116 (Object Oriented Programming Laboratory) (A) Final Examination Time: 1 hour 30 minutes Monster class. Monsters have to eat food, Each Monster has weight. Eating

image text in transcribed

CSE-1116 (Object Oriented Programming Laboratory) (A) Final Examination Time: 1 hour 30 minutes Monster class. Monsters have to eat food, Each Monster has weight. Eating food increases is imper isintelligent() and andemed from an interface cailed Antil now. weight, isintelligen expectedHeighte). For interface called Animal. Animal has the methods bravery, and name are set during, false otherwise. For any human, the prints a screamster can anly scare humans who are "not brave". Every time scare is human scream from the human if he is not brave "not brave". Every time scare is called, it Sacryivonster can seere everyone except those if nor, print a scream and increase the scarecount variable by 1. by using the istritelli sere everyone except those who are not intelligent which it determines it scared. In this soare"(i) method. Every time scare is called, it prints the name of the human isintelligent(); if true, print the function, check if a human is intelligent or not by calling 1. Main Class Code's been glven below. Generate output for this code: Human human 1 = new Human("Jon", 70, "medium", "brave"); Human human2 = new Human("5am", 100, "high", "not brave"); CookieMonster co0 = new CookieMonster(100); //weight 100kg coo.scare(human1); coo.scare(human2); coo.eati): System.out.printin(coo); //prints weight and scareCount here ScaryMonster doggo a new ScaryMonster (500) : //weight is 500kg initially. oggo.eat(human1); oggo. eat(human2): ystem.out.println(dogigo): CSE-1116 (Object Oriented Programming Laboratory) (A) Final Examination Time: 1 hour 30 minutes Monster class. Monsters have to eat food, Each Monster has weight. Eating food increases is imper isintelligent() and andemed from an interface cailed Antil now. weight, isintelligen expectedHeighte). For interface called Animal. Animal has the methods bravery, and name are set during, false otherwise. For any human, the prints a screamster can anly scare humans who are "not brave". Every time scare is human scream from the human if he is not brave "not brave". Every time scare is called, it Sacryivonster can seere everyone except those if nor, print a scream and increase the scarecount variable by 1. by using the istritelli sere everyone except those who are not intelligent which it determines it scared. In this soare"(i) method. Every time scare is called, it prints the name of the human isintelligent(); if true, print the function, check if a human is intelligent or not by calling 1. Main Class Code's been glven below. Generate output for this code: Human human 1 = new Human("Jon", 70, "medium", "brave"); Human human2 = new Human("5am", 100, "high", "not brave"); CookieMonster co0 = new CookieMonster(100); //weight 100kg coo.scare(human1); coo.scare(human2); coo.eati): System.out.printin(coo); //prints weight and scareCount here ScaryMonster doggo a new ScaryMonster (500) : //weight is 500kg initially. oggo.eat(human1); oggo. eat(human2): ystem.out.println(dogigo)

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

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

Refer to Example 10.18 and find a 90% confidence interval for /0.

Answered: 1 week ago