Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290