Software Devolopment My First Project
Software Devolopment My First Project
Intake : 52
Section : 1
Group Members:
Arman Danesh Chomok ID:
2023413037
Sabit Hasan Badhon
ID:2023410
Md Rizwon Ahmed
ID:2024420 Submitted To:
Project Title : Calendar and Age Calculator in C
Display Calendar Function :Displays the calendar for a specified year and
month .
This function has two parameter year and month .It returns void it means it
does not return anything .
(Variable Declaretions)
those are two integer variable used to store the number of days in the
specified month and the staring day of the week for that month.
(Defines Days in Month Array)
The arrays contains the number of days in each month of a non-leap
year.
The number of days in February is calculated dynamically using the
isLeapYear() function to handle leap years.
This conditon checks if the input month is valid or not .If its not
between 1 and 12 it will show the error messege.
.
‘daysInmonth’ is assigned the number of days in the specified month.
A ‘struct tm’ object ‘firstDayofmonth’ is created an initialized with the
specified year and month (with day set to 1).
The ‘mktime()’ function is called to normalize the ‘firstDayMonth’ struct
and calculate the day of the week (‘startingDay’) for the first day of the
month.
Display Calendar Header
Leading spaces are printed to align the first day of the month with the
correct weekly column.
Print Days Of the Month
The days of the month are printed ,with each day aligned in a 3- character
width.
If the current day completes a week (‘(day + startingDay)% ==0’),a
Newlinw is added to start a new row.
If the last line of the calendar is not complete (if the month ends before the end
of the week),a newline is printed to ensure proper formatting.
This function is defined to calculate and
display a person’s age based on their birth year.
It takes no parameters and does not return any value.