/* MultiwayBranch3.java David G. Klick September 21, 2007 CIS 111 Demonstrates nested if-then-else for multiway branching. This is a shortcut for the nested if-then-else version that helps eliminate some of the indentation and is a little easier to read for most programmers. It relies on not having to enclose a branch within curly braces if it is a single statement. */ public class MultiwayBranch3 extends CIS111App { public static void main(String[] args) { int month = getInt("What month number is it? "); print("Month number " + month + " is "); if (month == 1) { println("January"); } else if (month == 2) { println("February"); } else if (month == 3) { println("March"); } else if (month == 4) { println("April"); } else if (month == 5) { println("May"); } else if (month == 6) { println("June"); } else if (month == 7) { println("July"); } else if (month == 8) { println("August"); } else if (month == 9) { println("September"); } else if (month == 10) { println("October"); } else if (month == 11) { println("November"); } else if (month == 12) { println("December"); } else { println("not a valid month number"); } } }