-
Notifications
You must be signed in to change notification settings - Fork 0
/
Example9.java
65 lines (53 loc) · 1.53 KB
/
Example9.java
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<<<<<<< HEAD
import java.util.Scanner;
public class Example9 {
public static void main(String [] args)
{
Scanner input = new Scanner(System.in);
String yourname;
int years = 16;
System.out.println("Hey, what's your name?");
yourname = input.nextLine();
System.out.println("Ok, " + yourname + ", how old are you please? ");
years = input.nextInt();
if(years < 16)
{
System.out.println("You can't drive.");
}
if(years < 18)
{
System.out.println("You can't vote.");
}
if(years < 25)
{
System.out.println("You can't rent a car.");
}
}
}
=======
import java.util.Scanner;
public class Example9 {
public static void main(String [] args)
{
Scanner input = new Scanner(System.in);
String yourname;
int years = 16;
System.out.println("Hey, what's your name?");
yourname = input.nextLine();
System.out.println("Ok, " + yourname + ", how old are you please? ");
years = input.nextInt();
if(years < 16)
{
System.out.println("You can't drive.");
}
if(years < 18)
{
System.out.println("You can't vote.");
}
if(years < 25)
{
System.out.println("You can't rent a car.");
}
}
}
>>>>>>> 9aa901697f8b2b9364b7d06d3ed6430d8ad3b88c