Project 1


Project 1 is a preliminary project, the main purpose of which is to familiarize students with basic conditional statements and loop structures. It is suitable for the beginner to practice the basic C programming knowledge and skills.


[Step 1] write a program to calculate the day of the week

Use what you've learned to write a program called weekday.c to calculate the day of the week for a day from January to March 2018..

· Requirement: suppose that the month and day information entered by the user is reasonable. Start from Monday every week. It is known that January 1, 2018 is Monday.

· Knowledge Point: Basic input and output statements and if statements

· More information:step 1.pdf

· Sample outputs of this step:



[Step 2] write a program for printing the monthly calender

Use what you've learned to write a program called mcalendar.c that prints the calendar for a month from January to March 2018.

· Requirement: set variables to store the total number of days of each month.

· Knowledge Point: Use a while statement for conditional control

· More information:step 2.pdf

· Sample outputs of this step:



[Step 3] write a program to calculate the weekly calender

Use what you've learned to write a program called dcalendar.c that prints a weekly calendar for a week of the first six weeks of 2018.

· Requirement: first find out the beginning and end days of the week. Take the day of the year as the circulating variable to print the week calendar.

· Knowledge Point: Use a for statement for conditional control

· More information:step 3.pdf

· Sample outputs of this step:



[Step 4] write a program to calculate the days of holiday

Use the learned knowledge to write a named yholiday.c program. Print if it is public holiday days off (including Saturday and Sunday and other Chinese legal holidays).

· Requirement 1: integrate with the first four experiments.

· Requirement 2: use the function.

· Requirement 3: simplify the process.

· Knowledge Point: Start using functions to programme

· More information:step 4.pdf

· Sample outputs of this step: