Find and explain all the Errors in this code logical and syntax public class w {...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Find and explain all the Errors in this code logical and syntax public class w { static Scanner console = new Scanner(System.in): public double calcArea (double radius) { double area = Math.PI * radius * radius; return area; }//end of clacArea public static boolean isEvenNumber (int given) { if given % 2 == 0) return true; }//end of isEvenNumber public static void printAvgScore (String name, int grade1, int grade2) { double average; /local variable average = (gradel + grade2 + grade3)/3.0; System.out.println(name +"Average test score: + average); }//end of peintAvgScore public static String getRadius() { System.out.println("Enter Radius"); double myRadius = console.nextDouble); return myRadius; }//end of getRadius public static void main(String[] args) { Find and explain all the Errors in this code logical and syntax public class w { static Scanner console = new Scanner(System.in): public double calcArea (double radius) { double area = Math.PI * radius * radius; return area; }//end of clacArea public static boolean isEvenNumber (int given) { if given % 2 == 0) return true; }//end of isEvenNumber public static void printAvgScore (String name, int grade1, int grade2) { double average; /local variable average = (gradel + grade2 + grade3)/3.0; System.out.println(name +"Average test score: + average); }//end of peintAvgScore public static String getRadius() { System.out.println("Enter Radius"); double myRadius = console.nextDouble); return myRadius; }//end of getRadius public static void main(String[] args) {
Expert Answer:
Answer rating: 100% (QA)
import javautilScanner public class W static Scanner console new ScannerSystemin public static doubl... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Identify all the errors in the following repetition statements. Some errors are syntactical while others are logical (e.g., infinite loops). a. for (int i = 10; i > 0; i++) { x = y; a = b; } b. int...
-
List and explain all the various options now available for an organization to enjoy the services of an IS.
-
1. Implement the CheckingAccount.java based on the UML below. CheckingAccount is a subclass of BankAccount. A checking account has a transaction fee that is associated with all deposits and...
-
Based on the following definitions, which statement is NOT true? int[] 1DArray={1,2,3}; int[][] 2DArray=new int[2][]; 2DArray[0]={4,5}; 2DArray[1]={6,7,8}; public void method1(int[] 1DArray){...}...
-
As we saw in chapter 8, Exercise 40, between 1954 and 2013, swimmers have crossed Lake Ontario 58 times. Both women and men have made the crossing. Here are some plots (we've omitted a crossing by...
-
Denton Corporation employs 50 workers in its plant. Each employee is paid $10 per hour and works seven hours per day, Monday through Friday. Employees are paid every Friday. The last payday was...
-
I spent time with you. It seems that this deed is out of character for you. You were not awarded your normal annual bonus. I would probably feel the same. Is that what happened? You normally wouldnt...
-
At December 31, 2014, Navaro Corporation reported the following plant assets. During 2015, the following selected cash transactions occurred. Apr. 1 Purchased land for $2,200,000. May 1 Sold...
-
In the arrangement shown in the figure below, an object of mass m = 4.00 kg hangs from a cord around a light pulley. The length of the cord between point P and the pulley is L = 2.00 m. (Ignore the...
-
Write a program that accepts a number of quarts from a user and converts the value to gallons. Include exception-handling capabilities in the program so that while any nonnumeric value is entered,...
-
Fulfilment is at the heart of the customer experience and gets to what really matters. It drives loyalty and ensures customers return to the business. In order to grow, its important to keep the...
-
(a) Find a longest common subsequence (LCS) between the two sequences ZXYYZ and XYZYZ using dynamic programming. You only need to show the final contents of the dynamic programming table, the...
-
Company name - CompoSecure https://www.composecure.com/ Define Competitiveness: Select two jobs from each group (managerial/technical) and conduct a wage and salary survey.
-
Define an "ideal" project kick-off meeting? What would be covered during the meeting and who would be invited? Be creative and think through the concepts. What value does Stewardship have in a...
-
Calculate the mass of a solid gold rectangular bar that has dimensions lwh- 4.90 cm x 10.0 cm x 20.0 cm. (The density of gold is 19.3 x 10 3 kg/m 3 ).
-
The Cake Depot had a balance in their prepaid rent account of $1,320 at December 31, 2022. It was discovered through lease negotiations with the landlord that this account was overstated by $1,320....
-
1 . Describe one ( 1 ) social responsibility and one ( 1 ) managerial ethics practice which the organisation uses to engage with stakeholders and discuss the impact of these practices. 2 . Analyse...
-
An access route is being constructed across a field (Figure Q8). Apart from a relatively firm strip of ground alongside the field's longer side AB, the ground is generally marshy. The route can...
-
Why is systems integration more complicated when the systems involve the web than when they do not? Smart phones? Tablets?
-
What is the purpose of cost accounting ISs?
-
Companies would like to have systems that would allow them to store all the business related knowledge that their employees have accumulated. Do you expect that such systems will exist in your...
-
Repeat problem 44 for the truss on the right side of the figure. The properties of element 6 are same as those of element 5 , but T = 0 C T = 0 C . Data From Problem 44: The properties of the...
-
The truss shown in the figure supports the force \(F=1,000 \mathrm{~N}\). Both elements have the same axial rigidity of \(A E=10^{7} \mathrm{~N}\), thermal expansion coefficient of \(\alpha=2 \times...
-
Use the finite element method to solve the plane truss shown in problem 29. Assume \(A E=\) \(2 \times 10^{6} \mathrm{~N}, L=1 \mathrm{~m}, \alpha=10 \times 10^{-6} /{ }^{\circ} \mathrm{C}\). The...
Study smarter with the SolutionInn App