Thakur Polytechnic Diploma in Computer Engineering
Thakur Polytechnic Diploma in Computer Engineering
FYCO A
SEMESTER 2 (2022-2023)
SUBJECT: PROGRAMMING IN C
54.Yug Jain
55.Manish Jangid
56.Sanskar Javalekar
57. Aum Jha
58. Yash Jogle
This is to certify that the following group of students Roll.no. 54 to 58 of 2nd Semester
of Diploma in COMPUTEER ENGINEERING of institute, THAKUR
POLYTECHNIC (Code: 0522) have successfully completed the Micro Project
satisfactory in subject in – Programming in C (22226) for the academic year 2022-
2023 as prescribed in the curriculum.
Place: Mumbai
Date:
We feel immense pleasure in submitting this report on “Make a snake and ladder
game using C Programming.” While submitting this report, we avail this
opportunity to express our gratitude to all those who helped us in completing this
task. Heading the list with our own honorable Principal Dr.S.M. Ganechari who
is the beginner of our inspiration. We owe our deep gratitude and also very
thankful to our guide Ms. Kadambari Patil, Ms. Vaishali Rane (HOD-CO) and
Mrs., Pratibha Lotlikar, FY In charge who has proven to be more than just a
mere guide to us. Apart from bringing to us what can be joy of successful
completion of this project was only possible due to her guidance and co-
operation without which this work would never have been completed. Finally,
we wish to express our deep sense of respect and gratitude to each and every
staff member who has helped us in many ways and also our parents who have
always bared with us in any critical situation and to all others, sparing their time
and helping us for completion of this project in whatever way they could. And
lastly, we are grateful to each other member of our group.
THANK YOU!
INDEX
Sr. Description
No.
(Part 1) Micro Project Proposal.
1 Aim/Benefits of the Micro Project.
2 Course Outcomes Addressed.
3 Proposed Methodology.
4 Action Plan.
5 Resources Used.
3. Proposed Methodology
In order to complete this micro-project of Programming in C the procedure
that we will follow is given below.
Collection of information.
Coordination with necessary ethics.
Group discussion.
References from books and internet websites.
Execution of project.
Preparing report.
Presentation of project.
Project submission.
4. Action Plan
5. Resources Required
4. Literature Review
College database management systems are essential tools for educational institutions to
manage student information, course schedules, and other administrative functions. A
literature review shows that these systems can improve efficiency, data accuracy, and
decision-making processes. However, issues such as security and data privacy must be
carefully considered. Additionally, user training and system implementation can be
significant challenges. Overall, effective database management can enhance the overall
effectiveness of a college or university.
The design of the college database management system in C is simple and clean, making it
simple to learn, use and explore. Basic concept of C like
1)if-else statement - The if-else statement in C is used to perform the operations based on
some specific condition. The operations specified in if block is executed if and only if the
given condition is true.
2) void - It means “no type”, “no value” or “no parameters”, depending on the context. We
use it to indicate that: a function does not return value, a function does not accept parameters,
a pointer does not have a specific type and could point to different types.
3) printf - The printf() is a library function to send formatted output to the screen. The
function prints the string inside quotations. To use printf() in our program, we need to
include stdio.
4) scanf - The scanf() function reads data from the standard input stream stdin into the
locations given by each entry in argument-list. Each argument must be a pointer to a variable
with a type that corresponds to a type specifier in format-string.
5) for loop - A for loop is a repetition control structure that allows you to efficiently write a
loop that needs to execute a specific number of times.
6) switch statement - The is evaluated once and compared with the values of each label. If
there is a match, the corresponding statements after the matching label are executed. For
example, if the value of the expression is equal to, statements after are executed until is
encountered. If there is no match, the default statements are executed
case 2:
view();
break;
case 3:
search();
break;
case 4:
modify();
break;
case 5:
deleterec();
break;
case 6:
exit(1);
break;
default:
gotoxy(10,17);
printf("Invalid Choice.");
}
}
void add()
{
FILE *fp;
struct student std;
char another ='y';
system("cls");
fp = fopen("record.txt","ab+");
if(fp == NULL){
gotoxy(10,5);
printf("Error opening file");
exit(1);
}
fflush(stdin);
while(another == 'y')
{
gotoxy(10,3);
printf("<--:ADD RECORD:-->");
gotoxy(10,5);
printf("Enter details of student.");
gotoxy(10,7);
printf("Enter Name : ");
gets(std.name);
gotoxy(10,8);
printf("Enter Mobile Number : ");
gets(std.mobile);
gotoxy(10,9);
printf("Enter Roll No : ");
scanf("%d",&std.rollno);
fflush(stdin);
gotoxy(10,10);
printf("Enter Course : ");
gets(std.course);
gotoxy(10,11);
printf("Enter Branch : ");
gets(std.branch);
fwrite(&std,sizeof(std),1,fp);
gotoxy(10,15);
printf("Want to add of another record? Then press 'y' else 'n'.");
fflush(stdin);
another = getch();
system("cls");
fflush(stdin);
}
fclose(fp);
gotoxy(10,18);
printf("Press any key to continue.");
getch();
menu();
}
void view()
{
FILE *fp;
int i=1,j;
struct student std;
system("cls");
gotoxy(10,3);
printf("<--:VIEW RECORD:-->");
gotoxy(10,5);
printf("S.No Name of Student Mobile No Roll No Course Branch");
gotoxy(10,6);
printf("--------------------------------------------------------------------");
fp = fopen("record.txt","rb+");
if(fp == NULL){
gotoxy(10,8);
printf("Error opening file.");
exit(1);
}
j=8;
while(fread(&std,sizeof(std),1,fp) == 1){
gotoxy(10,j);
printf("%-7d%-22s%-12s%-9d%-12s%-
12s",i,std.name,std.mobile,std.rollno,std.course,std.branch);
i++;
j++;
}
fclose(fp);
gotoxy(10,j+3);
printf("Press any key to continue.");
getch();
menu();
}
void search()
{
FILE *fp;
struct student std;
char stname[20];
system("cls");
gotoxy(10,3);
printf("<--:SEARCH RECORD:-->");
gotoxy(10,5);
printf("Enter name of student : ");
fflush(stdin);
gets(stname);
fp = fopen("record.txt","rb+");
if(fp == NULL){
gotoxy(10,6);
printf("Error opening file");
exit(1);
}
while(fread(&std,sizeof(std),1,fp ) == 1){
if(strcmp(stname,std.name) == 0){
gotoxy(10,8);
printf("Name : %s",std.name);
gotoxy(10,9);
printf("Mobile Number : %s",std.mobile);
gotoxy(10,10);
printf("Roll No : %d",std.rollno);
gotoxy(10,11);
printf("Course : %s",std.course);
gotoxy(10,12);
printf("Branch : %s",std.branch);
}
}
fclose(fp);
gotoxy(10,16);
printf("Press any key to continue.");
getch();
menu();
}
void modify()
{
char stname[20];
FILE *fp;
struct student std;
system("cls");
gotoxy(10,3);
printf("<--:MODIFY RECORD:-->");
gotoxy(10,5);
printf("Enter name of student to modify: ");
fflush(stdin);
gets(stname);
fp = fopen("record.txt","rb+");
if(fp == NULL){
gotoxy(10,6);
printf("Error opening file");
exit(1);
}
rewind(fp);
fflush(stdin);
while(fread(&std,sizeof(std),1,fp) == 1)
{
if(strcmp(stname,std.name) == 0){
gotoxy(10,7);
printf("Enter name: ");
gets(std.name);
gotoxy(10,8);
printf("Enter mobile number : ");
gets(std.mobile);
gotoxy(10,9);
printf("Enter roll no : ");
scanf("%d",&std.rollno);
gotoxy(10,10);
printf("Enter Course : ");
fflush(stdin);
gets(std.course);
gotoxy(10,11);
printf("Enter Branch : ");
fflush(stdin);
gets(std.branch);
fseek(fp ,-sizeof(std),SEEK_CUR);
fwrite(&std,sizeof(std),1,fp);
break;
}
}
fclose(fp);
gotoxy(10,16);
printf("Press any key to continue.");
getch();
menu();
}
void deleterec()
{
char stname[20];
FILE *fp,*ft;
struct student std;
system("cls");
gotoxy(10,3);
printf("<--:DELETE RECORD:-->");
gotoxy(10,5);
printf("Enter name of student to delete record : ");
fflush(stdin);
gets(stname);
fp = fopen("record.txt","rb+");
if(fp == NULL){
gotoxy(10,6);
printf("Error opening file");
exit(1);
}
ft = fopen("temp.txt","wb+");
if(ft == NULL){
gotoxy(10,6);
printf("Error opening file");
exit(1);
}
while(fread(&std,sizeof(std),1,fp) == 1){
if(strcmp(stname,std.name)!=0)
fwrite(&std,sizeof(std),1,ft);
}
fclose(fp);
fclose(ft);
remove("record.txt");
rename("temp.txt","record.txt");
gotoxy(10,10);
printf("Press any key to continue.");
getch();
menu();
}
void gotoxy(int x,int y)
{
COORD c;
c.X=x;
c.Y=y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),c);
}
8. Skill Developed/ Learning outcome of the Micro Project:
In the complete duration of the micro project, each member of the team member has learned:
To use different user defined function, to break a program into many simplified parts
to deal with and to make it easier to understand the codes too.
To apply the file handling concepts in order to retrieve data enter by the user.
To use minimum graphics as far as possible to make the program execute fast but also
user-friendly side by side.
To use general concept of c language to develop a simple college database
management system which can help the user.