Find the errors in the following if statements. a. if x > 0 then System.out.print(x); b. if

Question:

Find the errors in the following if statements.


a. if x > 0 then System.out.print(x);
b. if (1 + x > Math.pow(x, Math.sqrt(2)) { y = y + x; }
c. if (x = 1) { y++; }
d. x = in.nextInt();
if (in.hasNextInt())
{
sum = sum + x;

}
else
{
System.out.println("Bad input for x");
}
e. String letterGrade = "F";
if (grade >= 90) { letterGrade = "A"; }
if (grade >= 80) { letterGrade = "B"; }
if (grade >= 70) { letterGrade = "C"; }
if (grade >= 60) { letterGrade = "D"; }

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: