-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRudeQuestions.java
More file actions
30 lines (23 loc) · 959 Bytes
/
RudeQuestions.java
File metadata and controls
30 lines (23 loc) · 959 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
26
27
28
29
30
import java.util.Scanner;
public class RudeQuestions {
public static void main(String[] arguments){
String name;
int age;
double weight, income;
Scanner keyboard = new Scanner(System.in);
System.out.print("Hello. What is your name? " );
name = keyboard.next();
System.out.print("Hi, " + name + "! How old are you? ");
age = keyboard.nextInt();
System.out.println("So you're " + age + ", eh? That's not very old.");
System.out.print("How much do you weigh, " + name + "? ");
weight = keyboard.nextDouble();
System.out.println(weight + "! Better keep that quiet!! ");
System.out.println("Finally, what's your income, " + name + "? ");
income = keyboard.nextDouble();
System.out.print("Hopefully that is " + income + " per hour");
System.out.println(" and not per year!");
System.out.print("Well, thanks for answering my rude questions, ");
System.out.println(name + ".");
}
}