Question
Note: The language is basic java Section 2: In this section you will determine possible errors and correct them: (Please find the errors in each
Note: The language is basic java
Section 2: In this section you will determine possible errors and correct them: (Please find the errors in each of the 8 lines)
1) String name=bob;
2) int number=20/3.0;
3) double m=23;
4) char x=a;
5) if(num>10);
System.out.println(num is num);
6) if(x=10)
System.out.println(x is equal to x;
Else
System.out.println(x is not equal to 10);
7) int sum=0;
for(int i=0;i<10;i++)
sum=sum+i;
System.out.printf(Sum is %5.2f ,sum);
8) If you want to print the following line
BOB MARLEY
You can use the following printf statement
System.out.printf(%S %S%d ,BOB,MARLEY)
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