001package hw3; 002 003import java.util.Scanner; 004 005/** 006 * Adder asks the user for two ints and computes their sum. 007 * 008 * This is part of HW0: Environment Setup and Java Introduction for CSE 331. 009 */ 010public class Adder { 011 012 public static void main(String[] args) { 013 Scanner console = new Scanner(System.in); 014 System.out.print("Enter first number: "); 015 int x = console.nextInt(); 016 System.out.print("Enter second number: "); 017 int y = console.nextInt(); 018 int sum = computeSum(x, y); 019 System.out.println(x + " + " + y + " = " + sum); 020 } 021 022 /** 023 * 024 * @param x First number to sum. 025 * @param y Second number to sum. 026 * @return sum of x and y. 027 */ 028 public static int computeSum(int x, int y) { 029 return x - y; 030 } 031}