-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntegerDemoInteractiveWithName.java
More file actions
30 lines (26 loc) · 1.08 KB
/
IntegerDemoInteractiveWithName.java
File metadata and controls
30 lines (26 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import java.util.Scanner;
public class IntegerDemoInteractiveWithName{
public static void main(String[] args)
{
Scanner input= new Scanner(System.in);
int anInt;
byte aByte;
short aShort;
long aLong;
String name;
System.out.print("Please enter an INTEGER: "); anInt=input.nextInt();
System.out.print("Please enter a BYTE: "); aByte=input.nextByte();
System.out.print("Please enter a SHORT: ");aShort=input.nextShort();
System.out.print("Please ener a LONG: "); aLong=input.nextLong();
int anotherInt= anInt *10000000;
System.out.println("The int is "+ anInt);
System.out.println("The byte is "+ aByte);
System.out.println("The short is "+ aShort);
System.out.println("The long is "+ aLong);
System.out.println("Another int is "+ anotherInt);
input.nextLine();
System.out.print("Please enter your name: "); name=input.nextLine();
System.out.println("Thank you, "+name);
input.close();
}
}