Starting from:

$30

Lab04. Calendar of the Month

EE231002 Introduction to Programming
Lab04. Calendar of the Month

In this lab, you are requested to write a C program that will generate a monthly calendar
for a given month of the year 2018. It is known that January 1st of 2018 is a Monday. From
this information and an integer given by a user specifying a month, your program will generate
a monthly calendar. Examples of program execution are shown below.
$ ./a.out
Input a month of 2018: 3
March 2018
Sun Mon Tue Wed Thu Fri Sat
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
$ ./a.out
Input a month of 2018: 10
October 2018
Sun Mon Tue Wed Thu Fri Sat
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
$ ./a.out
Input a month of 2018: 15
Input error, program aborts!
Note that input error handling is also included in your program, as shown in the example
output above.
Notes.
1. Create a directory lab04 and use it as the working directory.
2. Name your program source file as lab04.c.
1
3. The first few lines of your program should be comments as the following.
/* EE231002 Lab04. Calendar of the Month
ID, Name
Date:
*/
4. After finishing editing your source file, you can execute the following command to compile
it,
$ gcc lab04.c
If no compilation errors, the executable file, a.out, should be generated, and you can
execute it by typing
$ ./a.out
5. After you finish verifying your program, you can submit your source code by
$ ∼ee2310/bin/submit lab04 lab04.c
If you see a ”submitted successfully” message, then you are done. In case you want to
check which file and at what time you submitted your labs, you can type in the following
command:
$ ∼ee2310/bin/subrec lab04
It will show all your submission records for lab04.
2

More products