daily pastebin goal
61%
SHARE
TWEET

Untitled

a guest Oct 11th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package osu.cse1223;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Project01 {
  6.     public static void main(String[] args){
  7.        
  8.         Scanner myScanner = new Scanner(System.in);
  9.         int input1;
  10.         System.out.println("Enter your first number");
  11.         input1= myScanner.nextInt();
  12.         System.out.println("You entered " + input1);
  13.         int input2;
  14.         System.out.println("Enter your second number");
  15.         input2= myScanner.nextInt();
  16.         System.out.println("You entered " + input2);
  17.         int addition = input1 + input2;
  18.         System.out.println("The sum of your numbers is " + addition);
  19.         int subtraction = input1 - input2;
  20.         System.out.println("The difference of your numbers is " + subtraction);
  21.         int multiplication = input1 * input2;
  22.         System.out.println("The product of your numbers is  " + multiplication);
  23.         System.out.println("Now please enter your name");
  24.         String newName = myScanner.nextLine();
  25.         System.out.println("Hello, " + newName);
  26.         int namelength = newName.length();
  27.         System.out.println("Your name length is " + namelength);
  28.        
  29.        
  30.        
  31.        
  32.        
  33.        
  34.        
  35.        
  36.        
  37.     }
  38.  
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top