-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDate.java
More file actions
35 lines (25 loc) · 848 Bytes
/
Copy pathDate.java
File metadata and controls
35 lines (25 loc) · 848 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
31
32
33
34
35
/*
* Date.java
* ---------------------------
* From exercise 4.3 on the exercise
* part from chapter 4. This program is supposed to print
* in American format and European as well.
*/
public class Date {
public static void main(String[] args) {
String day, month;
int date, year;
day = "Tuesday";
month = "September";
date = 8;
year = 2020;
printAmerican(day, month, date, year);
printEuropean(day, date, month, year);
}
public static void printAmerican(String day, String month, int date, int year) {
System.out.println("American Standard date -> " + day + " " + month + " " + date + ", " + year + ".");
}
public static void printEuropean(String day, int date, String month, int year) {
System.out.println("European Standard date -> " + day + " " + date + " " + month + ", " + year + ".");
}
}