-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMonthName.java
More file actions
105 lines (98 loc) · 2.96 KB
/
Copy pathMonthName.java
File metadata and controls
105 lines (98 loc) · 2.96 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package assignment_10528808;
/**
*
* @author Mawutor
*/
public class MonthName
{
public static String month_name( int month )
{
String result;
if(month==1)
{
result="JANUARY";
return result;
}
else if(month==2)
{
result="Febuary";
return result;
}
else if(month==3)
{
result="March";
return result;
}
else if(month==4)
{
result="April";
return result;
}
else if(month==5)
{
result="May";
return result;
}
else if(month==6)
{
result="June";
return result;
}
else if(month==7)
{
result="July";
return result;
}
else if(month==8)
{
result="August";
return result;
}
else if(month==9)
{
result="September";
return result;
}
else if(month==10)
{
result="October";
return result;
}
else if(month==11)
{
result="November";
return result;
}
else if(month==12)
{
result="December";
return result;
}
else
{
result="Error";
return result;
}
}
public static void main( String[] args )
{
System.out.println( "Month 1: " + month_name(1) );
System.out.println( "Month 2: " + month_name(2) );
System.out.println( "Month 3: " + month_name(3) );
System.out.println( "Month 4: " + month_name(4) );
System.out.println( "Month 5: " + month_name(5) );
System.out.println( "Month 6: " + month_name(6) );
System.out.println( "Month 7: " + month_name(7) );
System.out.println( "Month 8: " + month_name(8) );
System.out.println( "Month 9: " + month_name(9) );
System.out.println( "Month 10: " + month_name(10) );
System.out.println( "Month 11: " + month_name(11) );
System.out.println( "Month 12: " + month_name(12) );
System.out.println( "Month 43: " + month_name(43) );
}
}