-
Notifications
You must be signed in to change notification settings - Fork 344
Expand file tree
/
Copy pathApp.java
More file actions
25 lines (17 loc) · 795 Bytes
/
App.java
File metadata and controls
25 lines (17 loc) · 795 Bytes
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
import java.util.Scanner;
public class App {
public static void main(String[] args) {
// Create scanner object
Scanner input = new Scanner(System.in);
// Output the prompt
System.out.println("Enter a floating point value: ");
// Wait for the user to enter something.
double value = input.nextDouble();
// Tell them what they entered.
System.out.println("You entered: " + value);
// Read an entire line (as a String) from the system input (keyboard)
String entireLine = input.nextLine();
// Prints the read line to the system output after having transformed it to uppercase
System.out.println(entireLine.toUpperCase());
}
}