Question: please use the given file below----- import java.util.Scanner; import static java.lang.System.*; public class MonsterRunner { public static void main( String args[] ) { //You may

please use the given file below-----
import java.util.Scanner; import static java.lang.System.*;
public class MonsterRunner { public static void main( String args[] ) { //You may only add to this method. You may not change what is already here. Scanner keyboard = new Scanner(System.in);
out.print("Enter 1st monster's name : "); String name = keyboard.next(); out.print("Enter 1st monster's size : "); int 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); if(mOne.isBigger(mTwo)) { out.println("Monster one is bigger than Monster two."); } if(mOne.isSmaller(mTwo)) { out.println("Monster one is smaller than Monster two."); } if(mOne.namesTheSame(mTwo)) { out.println("Monster one has the same name as Monster two."); } } } class Monster { //design your Monster class //write all code for your Monster class here //test your Monster class with the MonsterRunner }
A+ Computer Science MONSTER CHECK Lab Goal: This lab was designed to teach you more about designing and writing classes. 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. Use size to determine which Monster is largest / smallest Files Needed:: MonsterRunner.java Sample Runner Code: See MonsterRunner.java Sample Output: Enter lst monster's name : Tom Enter lst monster's size : 2 Enter and monster's name : Bob Enter 2nd monster's size : 4 Monster 1 - Tom 2 Monster 2 - Bob 4 Monster one is smaller than Monster two. Monster one does not have the same name as Monster two. Enter 1st monster's name : Sally Enter lst monster's size : 7 Enter 2nd monster's name : Fred Enter and monster'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 name as Monster two. Enter lst monster's name : Ann Enter lst monster's size : 1 Enter 2nd monster's name : Ann Enter 2nd monster's size : 4 Monster 1 - Ann 1 Monster 2 - Ann 4 Monster one is smaller than Monster two. Monster one has the same name as Monster two
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
