forked from AllenDowney/ThinkJavaCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExerciseFourPointThree.java
More file actions
42 lines (34 loc) · 1.02 KB
/
Copy pathExerciseFourPointThree.java
File metadata and controls
42 lines (34 loc) · 1.02 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
31
32
33
34
35
36
37
38
39
40
41
42
public class ExerciseFourPointThree
{
public static void main(String args[])
{
String day = "Thursday";
int date = 18;
String month = "January";
int year = 2018;
printAmerican(day, date, month, year);
printEuropean(day, date, month, year);
}
public static void printAmerican(String day, int date, String month, int year)
{
System.out.println("American format:");
System.out.print(day);
System.out.print(", ");
System.out.print(month);
System.out.print(" ");
System.out.print(date);
System.out.print(", ");
System.out.println(year);
}
public static void printEuropean(String day, int date, String month, int year)
{
System.out.println("European format:");
System.out.print(day);
System.out.print(" ");
System.out.print(date);
System.out.print(" ");
System.out.print(month);
System.out.print(" ");
System.out.println(year);
}
}