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 and/or 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 >>50 Enter the wind speed for Kecia >>30 The storm named Harold has a maximum wind speed of 50, and this storm is not severe. The storm named Kecia has a maximum wind speed of 30, and this storm is not severe. The storms are equally severe.
Task 1: The DebugStorm class compiles without error.
Task 2: The DebugBlizzard class compiles without error.
Task 3: The DebugHurricane class compiles without error.
Task 4: The DebugNine4 class compiles without error.
Task 5: The DebugNine4 program accepts user input.
public class DebugBlizzard inherits DebugStorm
{
public DebugBlizzard(String name, int speed)
{
super(name);
setWindSpeed(speed);
}
@Override
public void setWindSpeed(int speed)
{
super.windSpeed = Speed;
if(speed <45)
super.severity = False;
else
super.severity = True;
}
}
public class DebugHurricaine extends DebugStorm
{
final int SEVERE =95;
public DebugHurricaine(String name, int speed)
{
setWindSpeed(speed);
}
@Override
public void setWindSpeed(int speed)
{
super.windSpeed = speed;
if(speed < SEVERE)
super.severity = false;
else
super.severity = true;;
}
}
// Creates two Storm objects
// A hurricaine is severe if it has wind speeds of at least 95 mph
// A blizzard is severe if it has wind speeds of at least 45 mpg
// Two storms are equal if they have the same severity
import java.util.Scanner;
public class ebugNine4
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
DebugHurricaine hurr;
DebugBlizzard blizz;
String hName;
String bName;
int hSpeed;
int bSpeed;
System.out.print("Enter the name of the hurricaine >>");
hName = input.nextLine();
System.out.print("Enter the name of the blizzard >>");
bName = input.nextLine();
System.out.print("Enter the wind speed for "+
hName +">>");
hSpeed = input.nextInt();
System.out.print("Enter the wind speed for "+
bName +">>");
bSpeed = input.nextInt();
hurr = DebugHurricaine(hName, hSpeed);
blizz = DebugBlizzard(bName, bSpeed);
System.out.println(hurr.toString());
System.out.println(blizz.toString());
if(hurr.equals(blizz))
System.out.println("The storms are equally severe.");
else
System.out.println("The storms are not equally severe.");
}
}
public abstract class DebugStorm
{
String stormName;
String name = new String();
int windSpeed;
boolean severity;
public DebugStorm(String name)
{
stormName = name;
}
public boolean equals(Storm otherStorm)
{
boolean result;
if(severity == otherStorm.severity)
result = true;
else
result = false;
return result;
}
public String toString()
{
String msg ="is not severe.";
if(severity)
msg ="is severe.";
return("The storm named "+ stormName +
" has a maximum wind speed of "+ windSpeed +
", and this storm "+ msg);
}
public abstract void setWindSpeed(speed){};
}
Please debug the following 4 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!