Skip to main content
PFB assignment details.

Create a class named 'Calculator'.

Declare 2 Integer variables num1 and num2, initialize with some random numbers.

Create a method named 'calculate'.

Declare 4 variables add, sub, mul and div inside the method to perform addition, subtraction, multiplication and division of num1 and num2 respectively.

Display the results of each calculation using 'System.debug' statements in log
2 answers
0/9000