Question: public class CalculatorApp { public static void main(String[] args) { // create a calculation final double sideA = 3; final double sideB = 4; BinaryOperation
![public class CalculatorApp { public static void main(String[] args) { //](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3b881472f9_51266f3b880b3c74.jpg)
public class CalculatorApp {
public static void main(String[] args) { // create a calculation final double sideA = 3; final double sideB = 4; BinaryOperation pythagoreanCalculation = new BinaryOperation(new PowerOperator(), // Square root of new BinaryOperation(new AddOperator(), // A^2 + B^2 new BinaryOperation(new PowerOperator(), sideA, 2), new BinaryOperation(new PowerOperator(), sideB, 2)), 0.5);
final double sideC = pythagoreanCalculation.getResult(); if (Math.abs(sideC - 5) Your task is to implement the follow subsystem design Main BinaryOperation operator Binaryoperator CalculatorApp arg1op arg20p -arg1 : double = NaN -arg2 doubleNalN tapply (argl, arg2) +main : double +getResult) : double 1) determine arg1 2) determine arg2 3) apply operator on the args AddOperator PowerOperator +apply (argl, arg2) tapply (argi, arg2) : double : double argi arg2 Math.pow (argi, arg2) UML model of the class design of a Calculator app. The calculatorApp class is in the rit.calculator package. Your task is to write the rest of the code 1. The CalculatorApp mairn class is provided with code to calculate the hypotenuse using the Pythagorean theorem 2. Create the remaining classes in the UML design. 3. Ensure that the CalculatorApp runs and displays the string Pythagorean theorem works! sidec 5.0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
