Question: Assume that we have the following java code NewCircle.java: 1 public class NewCircle [ 2 int radius = 5 ; 3 double = 3 .

Assume that we have the following java code NewCircle.java:
1 public class NewCircle[
2 int radius =5;
3 double =3.1415;
4 public static void main(String [] arg)[
5 int k= radius;
6 sum();
7 public void sum 0[
8 double val=perimeter(radius);
9 System.out.printin(val);
10 public double perimeter(int k)[
11 retum (double) pi (:i**k}; }}
0- Save the file as NewCircle.java, compile it.
1- Identify how many syntax errors you are getting. (1 point)
2-Assume that there are two syntax errors. Provide the line numbers of both syntax errors.(3 points).
3- For line say x provide in details the syntax error that is taking place. (3 points).
4- For line say y provide in details the syntax error that is taking place. (3).
5- The code can be fixed by creating an object nc of the class NewCircle as follows:
NewCircle nc = new NewCircle();
identify the line at which you will place the above code. )
6- use nc to modify the above code so the lines that are causing the errors in 3- and 4- are fixed.()
7- Provide the value of val. Save the file that contains the corrected code as NewCricle1.java. Submit the code under: LastName_FirstName_NewCircle1.java.
 Assume that we have the following java code NewCircle.java: 1 public

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!