Question: Java Object-Oriented Programming Short Questions 4. (20 marks) Based on what we have learnt in our course with our questions. Suppose we are given a

Java Object-Oriented Programming Short QuestionsJava Object-Oriented Programming Short Questions 4. (20 marks) Based on what wehave learnt in our course with our questions. Suppose we are given

4. (20 marks) Based on what we have learnt in our course with our questions. Suppose we are given a class ETAClass. This given class has a class method someMethod() which accepts no input argument and returns no value, but potentially produces exception of a "special exception type SomeException back to the caller. Ignore the details of what this class and method actually do. Answer the coming questions. a) Write a public class WONGvg (named related to your surname) in Java for averaging numbers, so that the following program codes could be run as expected with this new class. (Use your own surname, suppose the student surname is WONG in the example program code below) o Body of all constructors and methods can have no more than 2 statements. Execution of the codes below would display on console the average result: 5.5 WONGvg ETA = new WONGavg(); WONGvg bETA = new WONGvg (2.2, 8.8); ETA.setAvg ( DETA); System.out.println( aETA.getAvg() ); [10 marks) o o 0 o (* Suppose exception type Number Format Exception) Sample Console Display Output Copa Coo Ae -20210 [10 marks/

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!