20 lines
486 B
Java
20 lines
486 B
Java
public class testCalculator{
|
|
public static void main(String[] args){
|
|
Calculator calc = new Calculator();
|
|
double num1 = 10.0;
|
|
double num2 = 5.0;
|
|
|
|
System.out.println(calc.getValue());
|
|
calc.add(num1);
|
|
System.out.println(calc.getValue());
|
|
calc.multiply(3);
|
|
System.out.println(calc.getValue());
|
|
calc.subtract(num2);
|
|
System.out.println(calc.getValue());
|
|
calc.divide(2);
|
|
System.out.println(calc.getValue());
|
|
calc.clear();
|
|
System.out.println(calc.getValue());
|
|
}
|
|
}
|