Question: The files provided in the code editor contain syntax and / or logic errors. In each case, determine and fix the problem, remove all syntax
The files provided in the code editor contain syntax andor logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly.
An example of the program is shown below:
Enter the name of the hurricane Harold Enter the name of the blizzard Kecia Enter the wind speed for Harold Enter the wind speed for Kecia The storm named Harold has a maximum wind speed of and this storm is not severe. The storm named Kecia has a maximum wind speed of and this storm is not severe. The storms are equally severe.
Task : The DebugStorm class compiles without error.
Task : The DebugBlizzard class compiles without error.
Task : The DebugHurricane class compiles without error.
Task : The DebugNine class compiles without error.
Task : The DebugNine program accepts user input.
public class DebugBlizzard inherits DebugStorm
public DebugBlizzardString name, int speed
supername;
setWindSpeedspeed;
@Override
public void setWindSpeedint speed
super.windSpeed Speed;
ifspeed
super.severity False;
else
super.severity True;
public class DebugHurricaine extends DebugStorm
final int SEVERE ;
public DebugHurricaineString name, int speed
setWindSpeedspeed;
@Override
public void setWindSpeedint speed
super.windSpeed speed;
ifspeed SEVERE
super.severity false;
else
super.severity true;;
Creates two Storm objects
A hurricaine is severe if it has wind speeds of at least mph
A blizzard is severe if it has wind speeds of at least mpg
Two storms are equal if they have the same severity
import java.util.Scanner;
public class ebugNine
public static void mainString args
Scanner input new ScannerSystemin;
DebugHurricaine hurr;
DebugBlizzard blizz;
String hName;
String bName;
int hSpeed;
int bSpeed;
System.out.printEnter the name of the hurricaine ;
hName input.nextLine;
System.out.printEnter the name of the blizzard ;
bName input.nextLine;
System.out.printEnter the wind speed for
hName ;
hSpeed input.nextInt;
System.out.printEnter the wind speed for
bName ;
bSpeed input.nextInt;
hurr DebugHurricainehName hSpeed;
blizz DebugBlizzardbName bSpeed;
System.out.printlnhurrtoString;
System.out.printlnblizztoString;
ifhurrequalsblizz
System.out.printlnThe storms are equally severe.";
else
System.out.printlnThe storms are not equally severe.";
public abstract class DebugStorm
String stormName;
String name new String;
int windSpeed;
boolean severity;
public DebugStormString name
stormName name;
public boolean equalsStorm otherStorm
boolean result;
ifseverity otherStorm.severity
result true;
else
result false;
return result;
public String toString
String msg is not severe.";
ifseverity
msg is severe.";
returnThe storm named stormName
has a maximum wind speed of windSpeed
and this storm msg;
public abstract void setWindSpeedspeed;
Please debug the following using java. I've been stuck on this one.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
