/* MultiwayBranch2.java David G. Klick September 21, 2007 CIS 111 Demonstrates nested if-then-else for multiway branching. This code is easy to turn into a flowchart, but requires a lot of typing and indentation. */ public class MultiwayBranch2 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"); } } } } } } } } } } } } } }