Advertisement
MelindaElezovic

InputHW

Oct 22nd, 2015
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. //Melinda
  2. //10.22.15
  3. //InputHW
  4. import java.util.Scanner;
  5.  
  6. public class InputHW
  7. {
  8.   public static void main(String[] args)
  9. {
  10.   Scanner input = new Scanner (System.in);
  11.  
  12.   System.out.println("Enter your name:: ");
  13.   String name = input.nextLine();
  14.   System.out.println("Please pick one integer");
  15.   int x = input.nextInt();
  16.   System.out.println("Pick another integer");
  17.   int y = input.nextInt();
  18.   System.out.println("Pick one more integer");
  19.   int z = input.nextInt();
  20.   int sum = x + y + z;
  21.   int diff = x - y - z;
  22.   int pro = x * y * z;
  23.   System.out.println(name + " the sum of your 3 integers is " + sum);
  24.   System.out.println(" the difference is " + diff);
  25.   System.out.println(" and the porducct is " + pro);
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement