-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtutorial_24.java
41 lines (31 loc) · 1.24 KB
/
tutorial_24.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
class Driver {
public static void main(String[] args) {
// setup some variables
String name = "Kate";
String lName = "Lolilagier";
// input data as variables or literals.
greeting(name, lName, 32);
// call method without arguments
line();
// call method with arguments
section(1);
System.out.println("a) Who's your favorite person that breathes?");
System.out.println("b) Do they like mangos?");
section(2);
System.out.println("a) Are you ok with people that walk?");
System.out.println("b) Do you drink water in any form?");
line();
}
static void line() {
System.out.println("---------------------------------");
}
static void section(int secNum) {
System.out.println("\nSection " + secNum + ":");
System.out.println("---------------------------------");
}
static void greeting(String name, String last, int age) {
// name varaible here is different than the one in the main method, but in this case is holding the same value.
System.out.print("Welcome, " + name + " " + last);
System.out.println(" of " + age + " years old.");
}
}