MonthlyCalendar

MonthlyCalendar - weekday" System.out.println"4...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
public class MonthlyCalendar { public static void main(String[] args) { final int[] daysPerMonth = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; final String noAppt = "no appointment"; System.out.print("For which month would you like to keep a calendar (1- 12)? "); int month = IO.readInt(); if (month < 1 || month > 12) { System.out.println("That is not a valid month."); IO.reportBadInput(); return; } System.out.print("On what day of the week does the month start (0-6)? "); int firstDayOfWeek = IO.readInt(); if (firstDayOfWeek < 0 || firstDayOfWeek > 6) { System.out.println("That is not a valid day of week."); IO.reportBadInput(); return; } while (true) { System.out.println(); System.out.println("Menu:"); System.out.println("1. Make appointment on a specific date"); System.out.println("2. Make repeating appointment"); System.out.println("3. Make appointment on next available
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: weekday"); System.out.println("4. Look up appointment on a specific date"); System.out.println("5. Look up date of an appointment"); System.out.println("6. Cancel appointment on a specific date"); System.out.println("7. Change details of appointment"); System.out.println("8. Change date of appointment"); System.out.println("9. Quit"); System.out.println(); System.out.print("Choice (1-9)? "); int choice = IO.readInt(); if (choice == 1) { } else if (choice == 2) { } else if (choice == 3) { } else if (choice == 4) { } else if (choice == 5) { } else if (choice == 6) { } else if (choice == 7) { } else if (choice == 8) { } else if (choice == 9) { return; } else { System.out.println("That is not a valid menu option."); IO.reportBadInput(); } } } }...
View Full Document

This note was uploaded on 11/03/2009 for the course CS 01-111 taught by Professor Pradiphari during the Fall '09 term at Rutgers.

Page1 / 3

MonthlyCalendar - weekday" System.out.println"4...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online