Padd Solutions

Converted by Falcon Hive

import java.util.Scanner;

public class Input
{
    public static void main (String[] args)
    {
        //String name = "Bob";
        //String name = new String ("Bob");
       
        Scanner scanning = new Scanner (System.in);
       
        System.out.print ("Enter a number. ");
       
        int num = scanning.nextInt ();
       
        System.out.println ("You typed in " +num);
       
       
        System.out.print ("Enter a number with a decimal ");
       
        double num2 = scanning.nextDouble ();
       
        System.out.println ("You typed in " +num2);
       
       
        //Scan a line of text
       
        System.out.print ("Enter some text. ");
       
        scanning.nextLine();
       
        String text = scanning.nextLine ();
       
        System.out.println ("You typed in " +text);
       

       
       
    }
}

(0) Comments

Post a Comment