Question
[10 marks]: Based on the provided information below, specify the Q3Compute.java class and its methods using standard Java annotation. [2 marks] This is the first
[10 marks]: Based on the provided information below, specify the Q3\Compute.java class and its methods using standard Java annotation.
-
[2 marks] This is the first version of class Compute, written by Faris Taweel and the date of release is 2020-01-21. Compute program implements an application that simply adds two given integer numbers, calculate the square root of the sum, and prints the output on the screen.
-
[2 marks] The method add is used to add two integers. It takes numA as its first parameter to add method and numB as its second parameter. The method returns an integer value which is the sum of of numA and numB.
-
[4 marks] The squareRoot method takes zero or a positive integer and returns a value of double type. The method throws an InvalidInputException if the constraint on the parameter value is violated.
-
[2 marks] The main method makes use of add method and squareRoot. Its parameter args is used to input two command line arguments. The method returns nothing. But, if command line arguments contain no integers, it throws and IOException. The reader is referred to IOException for more information.
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