Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 Questions
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 oStep 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