Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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:
public class NewCircle
int radius ;
double ;
public static void mainString arg
int radius;
sum;
public void sum
double valperimeterradius;
System.out.printinval;
public double perimeterint
retum double pi :;
Save the file as NewCircle.java, compile it
Identify how many syntax errors you are getting. point
Assume that there are two syntax errors. Provide the line numbers of both syntax errors. points
For line say provide in details the syntax error that is taking place. points
For line say y provide in details the syntax error that is taking place.
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.
use nc to modify the above code so the lines that are causing the errors in and are fixed.
Provide the value of val. Save the file that contains the corrected code as NewCriclejava. Submit the code under: LastNameFirstNameNewCirclejava.
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