Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The outline for the Code is given and I just have to fill in the braces. I cant change any of the outline. So basically

The outline for the Code is given and I just have to fill in the braces.
I cant change any of the outline.
So basically just fill in the braces to the Monster class and also fill in the runner so that it gives the output described in the lab.
Thank you!!
image text in transcribed
image text in transcribed
image text in transcribed
12:18 PM Sat Feb 2 63% A+ Computer Science MONSTER CHECK Lab Goal: This lab was designed to teach you more about if statements, if else statements, and if else if else statements. Lab Description Write a Monster class that stores the name and size of a Monster. Compare two monsters to see which is biggest and which is smallest. Sample Data Ton 2 Bob 4 Sally 7 Pred 2 Ann 1 Ann 4 Sample Output Enter 1st nonster s naneTo Enter 1st nonster's size 2 Enter 2nd monster s nane Bob Enter 2nd nonster s size 4 Nonster 1 Tom 2 Fron tostring() Monster 2 Bob 4 From tostring) Monster one is smaller than Monster two Monster one does not have the same name as Monster two Enter 1st monster's nane Sally Enter 1st nonster's size7 Enter 2nd nonster s nane Fred Enter 2nd nonster's size 2 Monster 1 Sally 7 Monster 2 Fred 2 Monster one is bigger than Monster two Monster one does not have the same nane as Monster two Enter 1st nonster snaneAnn Enter 1st nonster's size1 Enter 2nd nonster s nane Ann Enter 2nd nonster s size 4 Monster Ann 1 Monster 2 Ann 4 Monster one is smaller than Monster two Monster one has the same name as Monster two A+ Computer Science Lab 07 / felse if-www.apluscompsci.com import static java.lang.System. public class Monster private String name, private int howBig; public Monster) public Monster(String n, int size) public String getName0 return" public int getHowBig0 return 0; public boolean isBigger(Monster other) return false; public boolean is Smaller(Monster other) /call isBigger) use! return false; public boolean namesTheSame(Monster other) return false; public String toString0 return"" public class MonsterRunner public static void main( String args]) Scanner keyboard new Scanner(System.in); l/ask for name and size int size; String name, out.print("Enter 1st monster's name:"); name keyboard.next); out.print("Enter 1st monster's size:"); size-keyboard.nextint); Monster mOne new Monster(name, size); out.print("Enter 2nd monster's name: "); name keyboard.next(); out.print("Enter 2nd monster's size:" size-keyboard.nextint(); Monster mTwo new Monster(name, size); //instantiate monster one l/ask for name and size //instantiate monster two

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

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

8-6 Who poses the biggest security threat: insiders or outsiders?

Answered: 1 week ago