Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Zhenghao Zhu
- //10/24/15
- //Input Homework
- import java.util.Scanner;
- public class InputHomework{
- public static void main (String []args){
- Scanner input = new Scanner(System.in);
- System.out.print("Enter your full name: : ");
- String fullname = input.next();
- System.out.print(fullname + " could you please give me the first integer?");
- int n1 = input.nextInt();
- System.out.print(fullname + " could you please give me a second integer?");
- int n2 = input.nextInt();
- System.out.print(fullname + " could you please give me a third integer?");
- int n3 = input.nextInt();
- System.out.println(n1 + n2 + n3);
- System.out.println(n1 - n2 - n3);
- System.out.println(n1 * n2 * n3);
- n1 = n1 + n2 + n3;
- n2 = n1 - n2 - n3;
- n3 = n1 / n2 / n3;
- System.out.println(fullname + ", this are the results of adding, subtracting, and multiplying the numbers you gave me: ");
- System.out.println("Addition: " + n1);
- System.out.println("Subtraction: " + n2);
- System.out.println("Multiplication: " + n3);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement