Question: The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all

The files provided in the code editor to the right 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.

--The DebugFive2 class compiles without error.

--The DebugFive2 logic errors have been fixed.

--The DebugFive2 program accepts user input and displays the correct output.

An example of the program is shown below:

Enter a number 10 Enter another number 3 Neither of these numbers is evenly divisible into the other 

CODE:

// DebugFive2.java

// Decides if two numbers are evenly divisible

import java.util.Scanner;

public class DebugFive2

{

public static void main(String args[])

{

int num;

int num2;

Scanner input = new Scanner(System.in);

System.out.print("Enter a number ");

num = input.nextInt;

System.out.print("Enter another number ");

num2 = input.nextInt;

if((num % num2 == 0) && (num2 / num) == 0)

{

System.out.println("One of these numbers is");

System.out.println(" evenly divisible into the other");

}

else

{ System.out.println("Neither of these numbers is");

System.out.println(" evenly divisible into the other");

}

}

}

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 Databases Questions!