2021 Final Project Instructions

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Final Major Assignment

Due: Thursday January 28, 2021

The Gregorian calendar is the internationally accepted civil calendar. In the Gregorian calendar,
the day of January 1st, 1900 is Monday.

Write a Java program using the following methods to implement functions of Gregorian
Calendar since 1900. The program should be able to repeat options from user and exit the
program when user enter “exit”.

• Write a method named yearCalendar( ) to display a year calendar for any year from year
1900. User inputs a year number, and the program will display a 12 month calendar for that
year.

The header of the method should be

public static void yearCalendar (int year) { }

• Write a method named monthCalendar ( ) to display a month calendar for any given month of
any year after 1900.

The header of the method should be

public static void monthCalendar (String month, int year ) { }

Example output of the method:


January 1900

Mon Tue Wed Thu Fri Sat Sun


1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

• Write a method named dayNameFinder( ) to return the day of the week for any given date
from year 1900.

The header of the method should be

public static String dayNameFinder (String month, int day, int year) { }

For example, if the values of parameters are (“January”, 1, 1900), the return value should be
“Monday”

• Write a method named dateFinder ( ) to display the date from n days after February 1, 2021.

The header of the method should be

public static void dateFinder (int n) { }

For example, if the value of n is 25, the method should display “ February 26, 2021”
Resources you might need:

For Gregorian calendar:


http://en.wikipedia.org/wiki/Gregorian_calendar.

For Leap year:


http://en.wikipedia.org/wiki/Leap_year

You might also like