You are on page 1of 18

Report on Experiential Learning

B. Tech Program First Year


Course: Experiential Learning
Course Code: DA1001

“CONTACT MANAGEMENT SYSTEM”

by

YOUR NAME
(Reg. No:)
B.Tech. 2ND Year, Section - F

Under the guidance

of

Dr. Sourabh Singh


Associate Professor
Department of Computer Communication Engineering,
School of Computing & IT, Manipal University Jaipur, Jaipur

Department of Computer,
School of of Computing & IT,
Faculty of Engineering
Manipal University Jaipur, India

February,2022

1|Page
Report on Experiential Learning

Certificate
This is to certify that the project titled “Contact Management System” is a record of the bona
fide work done BY NAME submitted for the partial fulfilment of the requirements for the
completion of the Experiential Learning (DA1001) course in the Department of Computer Science
and Engineering of Manipal University Jaipur, during the academic session November 2021-
February 2022

Signature of the mentor


Name of the Mentor
Designation of the mentor
Department of _________

Signature of the HoD


Name of the HoD
Head of the Department
Department of _________

2|Page
Report on Experiential Learning

Abstract

The main objective of this project is to make an application using C language. An


application is created for adding contact details like mobile number, address and email id.
User can easily add the entries, edit or delete them. Every possible thing is done to make
this program simple in operating by user. As soon as the application opens a list of choices
are displayed to user. User have to select any of these operators.

3|Page
Report on Experiential Learning

Introduction

Many people struggle to keep a note of contacts and the details related to them. Also it
consumes a lot of time effort to manage them. To avoid these problems user can use this
program to manage the details. It is a simple console application without graphics. In
this application we can add, view, edit, search and delete contacts. All added and edited
records will be saved in a file.We can list contacts by name, phone no., address and email.
File handling will be used to record all data. This project will help to add, edit, search, list
and remove data using file.

4|Page
Report on Experiential Learning

Methodology

File handling is used to record all data.

 As soon as the application starts a list (as shown below) of operators is displayed to user

Now the user has to enter a choice, which are

1. Add a new contact - The user can add new contact information.
2. List all saved contact – The user can list all the saved contacts.
3. Search for contact – The user can search for any contact.
4. Edit a contact – The user can edit any saved contact.
5. Delete a contact – The user can delete any saved contact.
6. Exit – The user can close the application.

5|Page
Report on Experiential Learning

Results and Discussions


 Using this code, I have made the opening interface:

OUTPUT:

6|Page
Report on Experiential Learning

 Using this code, I have added the details of the contact:

OUTPUT:

7|Page
Report on Experiential Learning

 Using this code, I have listed the saved contacts:

OUTPUT:

8|Page
Report on Experiential Learning

 Using this code, I’ll search for the contacts which are saved:

9|Page
Report on Experiential Learning

 Using this code, I’ve made the application to edit the details
of saved contacts:

OUTPUT:

10 | P a g e
Report on Experiential Learning

 Using this codes I’ve made the application to delete a


contact:

OUTPUT:

11 | P a g e
Report on Experiential Learning

Conclusions
To summarise, an application is created for adding contact details like mobile number,
address and email id. User can easily add the entries, edit or delete them. Every possible
thing is done to make this program simple in operating by user.
It provides us with the following benefits :
 Group your contacts into categories
 Save time with the Search and Filter option

Future prospects
Our project will be able to implement in future after making some changes and
modifications as we make our project at a very low level. So, the modifications that can be
done in our projects are:
1. More operators will be added
2. I will try to develop the graphics of plotting graph.
3. I will make this program more user friendly.
4. I will try to store the datas in a new way so that user can access them.

12 | P a g e
Report on Experiential Learning

References
 Balagur.usamy .E., Programming In ANSI C, the Tata McGraw-Hill Companies,
8th Edition, 2008.
 Kanetkar Yashavat, Let Us C, BPB Publication, 9th Edition, 2009.
 Gottfriend, Baryon S, Schaum’s outlines Programming With C, the Tata
McGraw-Hill, 2007.
 www.google.com
 https://www.codewithc.com

13 | P a g e
Report on Experiential Learning

Acknowledgement

Presentation, inspiration and motivation have always played a key role in the success of
any venture. I express my sincere thanks to all the people who provided guidance to me
throughout this project and helped me to complete this project in the stipulated time. I
feel to acknowledge my indebtedness and deep sense of gratitude to my guide Dr.
Vijandra Singh whose valuable guidance and kind supervision given to me throughout
the course which shaped the present work as its show. Last but not the least, my parents
are also an important inspiration for me. So with due regards, I express my gratitude’s to
them.

14 | P a g e
Report on Experiential Learning

Codes:
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<process.h>
#include<stdlib.h>
#include<dos.h>
struct contact
{
long ph;
char name[20],add[20],email[30];
} list;
char query[20],name[20];
FILE *fp, *ft;
int i,n,ch,l,found;
int main()
{
main:
system("cls"); /* ************Main menu *********************** */
printf("\n\t **** Welcome to Contact Management System ****");
printf("\n\n\n\t\t\tMAIN MENU\n\t\t=====================\n\t\t[1] Add a new Contact\n\
t\t[2] List all Contacts\n\t\t[3] Search for contact\n\t\t[4] Edit a Contact\n\t\t[5] Delete a
Contact\n\t\t[0] Exit\n\t\t=================\n\t\t");
printf("Enter the choice:");
scanf("%d",&ch);
switch(ch)
{
case 0:
printf("\n\n\t\tAre you sure you want to exit?");
break;

/* *********************Add new contacts************ */

case 1:
system("cls");
fp=fopen("contact.dll","a");
for (;;)
{
fflush(stdin);
printf("To exit enter blank space in the name input\nName (Use identical):");
scanf("%[^\n]",&list.name);
if(stricmp(list.name,"")==0 || stricmp(list.name," ")==0)
break;
fflush(stdin);
printf("Phone:");
scanf("%ld",&list.ph);
fflush(stdin);

15 | P a g e
Report on Experiential Learning

printf("address:");
scanf("%[^\n]",&list.add);
fflush(stdin);
printf("email address:");
gets(list.email);
printf("\n");
fwrite(&list,sizeof(list),1,fp);
}
fclose(fp);
break;
case 2:
system("cls");
printf("\n\t\t================================\n\t\t\tLIST OF CONTACTS\n\t\
t================================\n\nName\t\tPhone No\t Address\t\tE-mail ad.\
n=================================================================\n\n");
for(i=97; i<=122; i=i+1)
{
fp=fopen("contact.dll","r");
fflush(stdin);
found=0;
while(fread(&list,sizeof(list),1,fp)==1)
{
if(list.name[0]==i || list.name[0]==i-32)
{
printf("\nName\t: %s\nPhone\t: %ld\nAddress\t: %s\nEmail\t: %s\n",list.name,
list.ph,list.add,list.email);
found++;
}
}
if(found!=0)
{
printf("=========================================================== [%c]-
(%d)\n\n",i-32,found);
getch();
}
fclose(fp);
}
break;
case 3:
system("cls");
do
{
found=0;
printf("\n\n\t..::CONTACT SEARCH\n\t===========================\n\t..::Name of
contact to search: ");
fflush(stdin);
scanf("%[^\n]",&query);
l=strlen(query);
fp=fopen("contact.dll","r");
system("cls");

16 | P a g e
Report on Experiential Learning

printf("\n\n..::Search result for '%s' \


n===================================================\n",query);

while(fread(&list,sizeof(list),1,fp)==1)
{
for(i=0; i<=l; i++)
name[i]=list.name[i];
name[l]='\0';
if(stricmp(name,query)==0)
{
printf("\n..::Name\t: %s\n..::Phone\t: %ld\n..::Address\t: %s\n..::Email\t: %s\
n",list.name,list.ph,list.add,list.email);
found++;
if (found%4==0)
{
printf("..::Press any key to continue...");
getch();
}
}
}
if(found==0)
printf("\n..::No match found!");
else
printf("\n..::%d match(s) found!",found);
fclose(fp);
printf("\n ..::Try again?\n\n\t[1] Yes\t\t[0] No\n\t");
scanf("%d",&ch);
}
while(ch==1);
break;
case 4:
system("cls");
fp=fopen("contact.dll","r");
ft=fopen("temp.dat","w");
fflush(stdin);
printf("..::Edit contact\n===============================\n\n\t..::Enter the name of
contact to edit:");
scanf("%[^\n]",name);
while(fread(&list,sizeof(list),1,fp)==1)
{
if(stricmp(name,list.name)!=0)
fwrite(&list,sizeof(list),1,ft);
}
fflush(stdin);
printf("\n\n..::Editing '%s'\n\n",name);
printf("..::Name(Use identical):");
scanf("%[^\n]",&list.name);
fflush(stdin);
printf("..::Phone:");
scanf("%ld",&list.ph);
fflush(stdin);

17 | P a g e
Report on Experiential Learning

printf("..::address:");
scanf("%[^\n]",&list.add);
fflush(stdin);
printf("..::email address:");
gets(list.email);
printf("\n");
fwrite(&list,sizeof(list),1,ft);
fclose(fp);
fclose(ft);
remove("contact.dll");
rename("temp.dat","contact.dll");
break;
case 5:
system("cls");
fflush(stdin);
printf("\n\n\t..::DELETE A CONTACT\n\t==========================\n\t..::Enter the name
of contact to delete:");
scanf("%[^\n]",&name);
fp=fopen("contact.dll","r");
ft=fopen("temp.dat","w");
while(fread(&list,sizeof(list),1,fp)!=0)
if (stricmp(name,list.name)!=0)
fwrite(&list,sizeof(list),1,ft);
fclose(fp);
fclose(ft);
remove("contact.dll");
rename("temp.dat","contact.dll");
break;
default:
printf("Invalid choice");
break;
}
printf("\n\n\n..::Enter the Choice:\n\n\t[1] Main Menu\t\t[0] Exit\n");
scanf("%d",&ch);
switch (ch)
{
case 1:
goto main;
case 0:
break;
default:
printf("Invalid choice");
break;
}
return 0;
}

18 | P a g e

You might also like