Q2: USING Java GRASP please DEBUG and type the new code // Practice debugging this program. It has approximately 22 compiler errors, 1 logic error and //1 usability error. Identify them all. import java.util.scanner; //This program finds the average of three input values. public class Arithmeticx { public static void main( String [] args ) // declare variables double number1, number2, number3; // input data scanner in = newscanner( ); System.out.print( "Number 1? " ); System.out.print( "Number 2? " ); System.out.print( "Number 3? " ); number 1 = in.nextDouble; number 2 = in.nextDouble; number 3 = in.nextDouble; // calculate average average = num1 + num2 + num3 / 3; // print results system.out.print( Number1 + ", " + Number2 + " & " + Number3 ); system.out.println( " averages to " + average ); }
Q2: USING Java GRASP please DEBUG and type the new code
// Practice debugging this program. It has approximately 22 compiler errors, 1 logic error and
//1 usability error. Identify them all.
import java.util.scanner;
//This program finds the average of three input values.
public class Arithmeticx
{
public static void main( String [] args )
// declare variables
double number1, number2, number3;
// input data
scanner in = newscanner( );
System.out.print( "Number 1? " );
System.out.print( "Number 2? " );
System.out.print( "Number 3? " );
number 1 = in.nextDouble;
number 2 = in.nextDouble;
number 3 = in.nextDouble;
// calculate average
average = num1 + num2 + num3 / 3;
// print results
system.out.print( Number1 + ", " + Number2 + " & " + Number3 );
system.out.println( " averages to " + average );
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps