Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package osu.cse1223;
- import java.util.Scanner;
- public class Project01 {
- public static void main(String[] args){
- Scanner myScanner = new Scanner(System.in);
- int input1;
- System.out.println("Enter your first number");
- input1= myScanner.nextInt();
- System.out.println("You entered " + input1);
- int input2;
- System.out.println("Enter your second number");
- input2= myScanner.nextInt();
- System.out.println("You entered " + input2);
- int addition = input1 + input2;
- System.out.println("The sum of your numbers is " + addition);
- int subtraction = input1 - input2;
- System.out.println("The difference of your numbers is " + subtraction);
- int multiplication = input1 * input2;
- System.out.println("The product of your numbers is " + multiplication);
- System.out.println("Now please enter your name");
- String newName = myScanner.nextLine();
- System.out.println("Hello, " + newName);
- int namelength = newName.length();
- System.out.println("Your name length is " + namelength);
- }
- }
Add Comment
Please, Sign In to add comment