Calculator.java 467B

12345678910111213141516171819
  1. /**
  2. * Write a description of class Calculator here.
  3. *
  4. * @author (your name)
  5. * @version (a version number or a date)
  6. */
  7. public class Calculator
  8. {
  9. public void run()
  10. {
  11. System.out.println("Enter a number,n, to get sum of 1 to n");
  12. Console console = new Console();
  13. SumOfInput sumOfInput = new SumOfInput();
  14. int aSumOfInput = sumOfInput.sumOfInput(console.getUserInput());
  15. console.printSumOfInput(aSumOfInput);
  16. }
  17. }