Sixth lab: Calendar: Part 2

01 Mar 2022 - 15:15 | Version 1 |

Learning Objective(s)

  1. Learn to use methods
  2. Add to an existing program to get further along in the project

Overview of the program

This lab should print out a calendar for an entire year.

  • This program needs to output (nicely) an entire year. You are to get from the user the year and the day that year starts on (0 for Sunday).
  • I recommend you use code from the previous lab.
  • The year can be from 1800 to 2300
  • You are to create a method to get the year from the user. It must return a valid year.
  • You are to create a method to get the starting day (from 0 to 6) from the user. It must return a valid starting day.
  • You are to create a method that determines the number of days in a month (given a specific year and month).
  • You are to write a method the outputs an entire calendar for a given month.
  • You are to write a method that returns the name of the month to be printed by the method that calls it.
  • Use all previous methods to output a calendar for an entire year.
  • The program should be called Calendar

Submission

  1. Create an empty zip folder.
  2. Place your program (.java file) in it
  3. Place your software development report in it.
  4. Submit the zip folder on canvas

Optional improvements

Optional improvements should ONLY be worked on once the program is completing working. In addition, the work is to be done on your own with little if any help for lab assistants or the instructor.
  1. Have your program determine what day the month starts on instead of inputting it.
  2. Write only one method that gets one value from the user (for the starting day or year) and call it twice. It still must check for a valid number and use appropriate prompts. The method itself needs to be very generic and not know it is working with years, etc.
  3. Create a printWeek method (and use it appropriately) that will print any given week.
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
This website is using cookies. More info. That's Fine