Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Inspect the following code for syntax errors, correct the error by stating the line number and re-write the line of code involved. You do not
Inspect the following code for syntax errors, correct the error by stating the line number and re-write the line of code involved. You do not have to re-write the entire program. There are six errors.
1 import java.lang.Scanner;
2
3 public class PositiveNegative
4 {
5 public static main(String [] args)
6 {
7 double number = 0;
8
9 Scanner input = new Scanner(system.in);
10
11 System.out.print("Enter a number ==> ");
12 number = input.nextDouble()
13
14 if (number < 0) then
15 System.out.println("Negative ");
16 else
17 System.out.println("Positive");
18 )
19 }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started