Design a sub-class of SimpleCalculator called Calculator using psudoecode that contains public methods named multiply(), and divide() and that defines private fields called num1 and num2. Each of the methods accepts two numeric arguments and returns a number that represents the result of the appropriate Calculator operation. Design a two-arg constructor Calculator() that sets the two values num1 and num2. Design a main() method that prompts the user for two numbers and reads them in. Then creates an instance of the Calculator class setting the input values via the Calculator constructor. The main() method then tries each of the four arithmetic methods. Assume that an CalculatorException is created and thrown if the user attempts to divide by 0. Display an appropriate message when an exception is caught. If no exception, display the results from each arithmetic method call.

Class SimpleCalculator

Public Static num add(num x, num y)
num sum
sum= x+y
Return sum
Public Static num sub(num x, num y)
num subtract
subtract= x- y
Return subtract
Endclass
Class Calculator inheritsFrom SimpleCalculator
// Declarations
Private num num1
Private num num2
Public Static num multiply(num x, num y)
num multiply
multiply= x*y
Return multiply
Public Static num divide(num x, num y)
Num divide
divide= x/y
Return divide
Public Calculator(num x, num y)
num1=x
num2=y
Public num add()
Return(num1+num2)
Public num subtract()
Return (num1-num2)
Public num multiply()
Return (num1*num2)
Public num divide()
Return (num1/num2)

Public static void main ()
// Declaration
Num a
Calculator c1= new Calculator(numx, num y)
a=c1.add(6,9)
Output “ the sum is” + a
a=c1.multiply(2,10)
Output” the result of multiplication” + a
a=c1.subtract(6,9)
Output “ the difference is” + a

try
a=c1.divide(5,0)
a=c1.divide()
endtry

catch( ArithmeticException mistake)
output “cannot divide by 0”
endcatch
Output “ the result of division is” + a

return
endmain
endclass

Pseudocode:

```
class Calculator extends SimpleCalculator
private num1
private num2

constructor Calculator(num1, num2)
this.num1 = num1
this.num2 = num2

public multiply(num1, num2)
return num1 * num2

public divide(num1, num2)
if num2 is 0
throw CalculatorException("Cannot divide by 0")
else
return num1 / num2

function main()
try
num1 = readNumberFromUser()
num2 = readNumberFromUser()
calculator = new Calculator(num1, num2)

result_multiply = calculator.multiply(num1, num2)
result_divide = calculator.divide(num1, num2)

display "Multiply result: " + result_multiply
display "Divide result: " + result_divide

catch CalculatorException
display "Error: Cannot divide by 0"
end
```

In the given pseudocode, `Calculator` is a subclass of `SimpleCalculator`. It has private fields `num1` and `num2` to store the given numbers. The class also has a constructor `Calculator(num1, num2)` that sets the values of `num1` and `num2`.

The class contains two public methods, `multiply(num1, num2)` and `divide(num1, num2)`, which perform the corresponding arithmetic operations using the given arguments.

In the `divide(num1, num2)` method, a check is made to see if `num2` is zero. If it is, a `CalculatorException` is thrown, indicating that division by zero is not allowed. Otherwise, the division operation is performed and the result is returned.

The `main()` function prompts the user for two numbers, reads them in, and creates an instance of the `Calculator` class using the input values via the constructor. It then tries to call `multiply()` and `divide()` methods on the `calculator` object, storing the results in `result_multiply` and `result_divide` respectively.

If no exception is caught, the program displays the results from each arithmetic method call. If an exception is caught, it displays an appropriate error message indicating that division by zero is not allowed.