0% found this document useful (0 votes)
18 views6 pages

Software Devolopment My First Project

My first project in Bubt

Uploaded by

Arman Danesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views6 pages

Software Devolopment My First Project

My first project in Bubt

Uploaded by

Arman Danesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Lab Report

Course Title : Software Development I


Course Code : CSE 100

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

Tools and Libraries:


Libraries : #include<stdio.h>
#include<time.h> (for time related function)
Tools : Loop , Function, structure function.

 This program consist two functionalities:


1. Year Calendar : Displays a calendar for specified year and month.
2.Age Calculator: Calculates the user’s age based on their birth year
and current year.

Leap Year function : Determines whether a given year is a leap year.

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.

Define Months name with Array :

This array contains the names of the months,indexed from


0 to 11.
Input Validation:

This conditon checks if the input month is valid or not .If its not
between 1 and 12 it will show the error messege.

Determine days in month and starting day

.
‘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

The header of the calender is printed ,showing the month and


year,followed by the days of the week.
Print Leading Spaces

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.

Two integer variables,’birthYear’ and ‘currentYear’,are declared.

‘time_t’ is a data type used to represent calendar time.


time(&now); he time() function takes a pointer to a time_t object and fills it
with the current calendar time (the number of seconds elapsed since the
Epoch, which is 00:00:00 UTC on January 1, 1970).

You might also like