11. In the following code, correct any errors that would prevent the program fro
ID: 3601068 • Letter: 1
Question
11. In the following code, correct any errors that would prevent the program from compiling or running and write output. Point 5 package javaapplication4; import java.util.Scanner; public class JavaApplication4 public static void main(Stringll args) f int a 4, b = 5; boolean found = true; if a b b && 10 b; System.out.println("found"+found); else found -2 2> b; System.out.println("found- found); if found a 3; c 15 System.out.printIn(''a="4at. "be" + b + "c="+ c); if b>a a 1; System.out.printIn("a="+a+"be" + b + "c -''t c);Explanation / Answer
use the main function as this:
public static void main(String args[]) {
int a=4,b=5;
boolean found=true;
if((a>b*b)&&(10<b)){
found = 2*a>b;
System.out.println("found="+ found);
}
else{
found = 2*2>b;
System.out.println("found="+found);
}
if(found){
a=3;
int c=15;
System.out.println("a="+a+"b="+b+"c="+c);
if(b>a){
b=0;
a=1;
System.out.println("a="+a+"b="+b+"c="+c);
}
}
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.