adder
Category: Programming
Author: Benson Limketkai
Book Chapter: 5.4
Problem: adder
Write a static method named adder that takes a Scanner for the console as input and repeatedly asks the user for two numbers to sum. The method stops asking for numbers when two consecutive sums are the same and prints out how many sums were computed. You may assume that the user will always type exactly two integers per prompt. The following sample logs of execution show the output produced by the method: Sample Log 1: Enter two numbers: 1 2 The sum is: 3 Enter two numbers: 3 4 The sum is: 7 Enter two numbers: 5 6 The sum is: 11 Enter two numbers: 1 2 The sum is: 3 Enter two numbers: 0 3 The sum is: 3 We computed 5 sums. Sample Log 2: Enter two numbers: 0 0 The sum is: 0 Enter two numbers: -1 1 The sum is: 0 We computed 2 sums.