leo_kor

Calculator Launcher

Apr 9th, 2020
508
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. public class CalcLauncher {
  2.     public static void main(String[] args) {
  3.         // Create the actual objects
  4.         CalcService calculator = new CalcService();
  5.         CalcHelper helper = new CalcHelper();
  6.  
  7.         // Print the instructions to the user
  8.         helper.printInstructions();
  9.  
  10.         // Set the values
  11.         calculator.setA(helper.readDouble());
  12.         calculator.setB(helper.readDouble());
  13.  
  14.         // Choose operator
  15.         calculator.setOperator(helper.readString());
  16.  
  17.         // Select operation
  18.         helper.operationSelect(calculator.getOperator(),calculator.getA(), calculator.getB());
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment