Commit d73fe499 authored by elijah vasquez's avatar elijah vasquez 🦍

ver 4

parent 4d7c5ee8
...@@ -36,8 +36,45 @@ public class App { ...@@ -36,8 +36,45 @@ public class App {
} }
// Exercise 5 - Branching - switch // Exercise 5 - Branching - switch
int month = 1; int month = 3; // Ex 5.1
switch (month) {
case 1:
System.out.println("January");
break;
case 2:
System.out.println("February");
break;
case 3:
System.out.println("March");
break;
case 4:
System.out.println("April");
break;
case 5:
System.out.println("May");
break;
case 6:
System.out.println("June");
break;
case 7:
System.out.println("July");
break;
case 8:
System.out.println("August");
break;
case 9:
System.out.println("September");
break;
case 10:
System.out.println("October");
break;
case 11:
System.out.println("November");
break;
case 12:
System.out.println("December");
break;
}
// Exercise 6 - Looping - for loop // Exercise 6 - Looping - for loop
// Exercise 7 - Looping - while(), do{} while() // Exercise 7 - Looping - while(), do{} while()
...@@ -50,4 +87,3 @@ public class App { ...@@ -50,4 +87,3 @@ public class App {
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment