Consider the following application. Identify and correct any syntactic errors or omissions by rewriting the line number and the corrected line. Note: There are 8 lines with errors. Each line may have multiple errors. Here’s an example (here, the error is on line 2, the correction is in bold – int x = 0;): 01 public static void main(String[] args){ 02 int x = '0'; 02 int x = 0; 03 int y + x = 7 03 int y = x + 7; 04 } 01 public Class Average; 02 { 03 public void main(String [] args) 04 { 05 double sc = (70, 75, 90, 83, 85, 97, 82, 79, 94, 87; 06 double me su = 0.0 07 for (int k = 0; k < sc.length(); k++); 08 su += sc[ ]; 09 double me = su/sc.length() 10 System.Out.printf("Output: %.2f" + me); 11 } 12 } What value of the variable me will be printed in line 10?
Consider the following application. Identify and correct any syntactic errors or omissions by rewriting the line number and the corrected line. Note: There are 8 lines with errors. Each line may have multiple errors.
Here’s an example (here, the error is on line 2, the correction is in bold – int x = 0;):
01 public static void main(String[] args){ |
|
02 int x = '0'; |
02 int x = 0; |
03 int y + x = 7 |
03 int y = x + 7; |
04 } |
01 public Class Average;
02 {
03 public void main(String [] args)
04 {
05 double sc = (70, 75, 90, 83, 85, 97, 82, 79, 94, 87;
06 double me su = 0.0
07 for (int k = 0; k < sc.length(); k++);
08 su += sc[ ];
09 double me = su/sc.length()
10 System.Out.printf("Output: %.2f" + me);
11 }
12 }
What value of the variable me will be printed in line 10?
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images