0% found this document useful (0 votes)
144 views25 pages

Dsa Miniproject Report PDF

Uploaded by

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

Dsa Miniproject Report PDF

Uploaded by

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

lOMoARcPSD|20973084

DSA Miniproject Report

data structures (Visvesvaraya Technological University)

Studocu is not sponsored or endorsed by any college or university


Downloaded by Kunal Khatik ([email protected])
lOMoARcPSD|20973084

VISVESVARAYA TECHNOLOGICAL UNIVERSITY


JNANASANGAMA, BELAGAVI – 590018

Mini Project Report


On

“PHONEBOOK APPLICATION”

Submitted in partial fulfilment for the award of degree of

Bachelor of Engineering
In
Computer Science and Engineering
Submitted by

Name-CHITRANSH DIXIT
USN- 1RF20CS025
Name-ANSHAJ BHUSAN
USN- 1RF20CS015
Name-ANJAN KUMAR
USN- 1RF20CS014

RV Institute of Technology and Management®


(Affiliated to VTU, Belagavi)

JP Nagar, Bengaluru - 560076

Department of Computer Science and Engineering

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

RV Institute of Technology and Management®


(Affiliated to VTU, Belagavi)

JP Nagar, Bengaluru - 560076

Department of Computer Science and Engineering

CERTIFICATE
Certified that the Mini project entitled “PHONEBOOK APPLICATION” carried out by
Name-CHITRANSH DIXIT
USN- 1RF20CS025
Name-ANSHAJ BHUSAN
USN- 1RF20CS015
Name-ANJAN KUMAR
USN- 1RF20CS014
Is a bonafied students of III Semester B.E, RV Institute of Technology and Management
in partial fulfilment for the Bachelor of Engineering in COMPUTER SCIENCE AND
ENGINEERING, of the Visvesvaraya Technological University, Belagavi, during the
academic year 2021 - 2022. The Mini project report has been approved as it satisfies the
academic requirements in respect of Data Structures and Applications.

Dr. Savitha G
Associate Professor
Dept. CSE
RVITM, Bengaluru - 560076

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

ABSTRACT
Phone book application is primarily meant for keeping the records
of the persons. Phone book application will provide the basic set of
features of adding a new contact, searching, updating, deleting a contact.
This mini project in C Phonebook allows to perform simple Phonebook
operations like in the mobile. One can add, list, modify, search and
delete Phonebook-related records. File handling and data structure
concepts has been extensively used for almost all functions in this mini
project. Phonebook in C is a console application without graphics. The
source code is complete and totally error-free. It is compiled in Code
Blocks with GCC compiler. Functions, file handling and data structure
are used. This application contains how to add, list, modify or edit,
search and delete data to/from the file. Adding new records, listing them,
modifying them and updating, search for contacts saved, and deleting
the phonebook records are the basic functions which make up the main
menu of this Phonebook application. Personal information such as
name, gender, father’s name, phone number, citizenship number, email
and address are asked while adding a record into the Phonebook. These
records can then be modified, listed, searched for and removed.

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

Table of Contents

CONTENTS

1. Cover Page.
2. Table of Content.
3. Table of Figure and Tables.
ABSTRACT
4. Introduction
1.1 Introduction to the project
1.2 Introduction to the application
1.3 Relevance of the application.
5. Design -Algorithm
6. Implementation details / Program Code
7. Experimental Results/Snapshots
8. Conclusion and future extension.
9. References.

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

INTRODUCTION

Phonebook is a very simple mini project in C that can help you understand the basic
concepts of functions, file handling and data structure. This application will teach you how
to add, list, modify or edit, search and delete data to/from the file.

Adding new records, listing them, modifying them and updating, search for contacts saved,
and deleting the phonebook records are the basic functions which make up the main menu of
this Phonebook application (as shown in the main menu screenshot below).

Personal information such as name, sex, father’s name, phone number, citizenship number,
email and address are asked while adding a record into the Phonebook. These records can
then be modified, listed, searched for and removed. It is estimated that there are more than
600 million mobile phone users around the world – and the number is increasing. The success
of mobile phones seems easy to explain: being available anytime and anywhere. If a
businessman moves from one place to another he is available for his company at no extra
effort. If the son will be late at home he can inform his parents. If you have trouble with your
car you can call the breakdown service. Mobile phones are used for communication but also
for coordination between people. Informal meetings between people (e.g. going to a pub) are
often not planned anymore in advance – they are arranged on time by mobile communication.
Altogether there are a lot of opportunities using mobile phones. But there are also some
emerging problems. Being reachable always and everywhere is solved by technology – but
being reachable does not necessarily mean being available to all potential callers! Sharing
information about the real-world context of users is a solution to this problem. But until now
the user interfaces of mobile phones are still very much based on legacy. In particular UIs

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

and standard applications are not context dependent and therefore the caller
has very little chance to know when making a call in what situation the
called party will be interrupted.
The main idea of the program is to increase the awareness of working with
computer systems and utilize computer resources for better result
orientation. The main target behind the creation of this package is to remove
the pressure from the user to learn about computer & software. It helps to
maintain an automatic communication between the computer and the user.
This Program “My Phonebook” facility the user with different records can
add and search easily by using Button tools & Search options. There are
some features also like: - Viewing Data in Data grid, and Logout. Our
Project has following:- Login form “ADD” button for adding data in
Database. “DELETE” button for deleting data in Database. “UPDATE”
button for updating data in Database. “SEARCH” button for searching data
in Database.

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

PROGRAM CODE

#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <stdlib.h>
#include <windows.h>

struct person
{
char name[35];
char address[50];
char father_name[35];
char mother_name[30];
long int mble_no;
char sex[8];
char mail[100];
char citision_no[20];

};
void menu ();
void got ();
void start ();
void back ();
void addrecord ();
void listrecord ();
void modifyrecord ();
void deleterecord ();
void searchrecord ();
int
main ()
{
system ("color 5f");
start ();
return 0;
}

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

void
back ()
{
start ();
}

void
start ()
{
menu ();
}

void
menu ()
{
system ("cls");
printf ("\t\t**********WELCOME TO PHONEBOOK*************");

printf ("\n\n\t\t\t MENU\t\t\n\n");


printf("\t1.Add New \t2.List \t3.Exit \n\t4.Modify \t5.Search\t6.Delete");

switch (getch ())


{
case '1':

addrecord ();
break;
case '2':
listrecord ();
break;
case '3':
exit (0);
break;
case '4':
modifyrecord ();
break;

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

case '5':
searchrecord ();
break;
case '6':
deleterecord ();
break;
default:
system ("cls");
printf ("\nEnter 1 to 6 only");
printf ("\n Enter any key");
getch ();

menu ();
}
}

void
addrecord ()
{
system ("cls");
FILE *f;
struct person p;
f = fopen ("project", "ab+");
printf ("\n Enter name: ");
got (p.name);
printf ("\nEnter the address: ");
got (p.address);
printf ("\nEnter father name: ");
got (p.father_name);
printf ("\nEnter mother name: ");
got (p.mother_name);
printf ("\nEnter phone no.:");
scanf ("%ld", &p.mble_no);
printf ("Enter sex:");
got (p.sex);
printf ("\nEnter e-mail:");
got (p.mail);

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

printf ("\nEnter citizen no:");


got (p.citision_no);
fwrite (&p, sizeof (p), 1, f);

fflush (stdin);
printf ("\nrecord saved");

fclose (f);

printf ("\n\nEnter any key");

getch ();
system ("cls");
menu ();
}

void
listrecord ()
{
struct person p;
FILE *f;
f = fopen ("project", "rb");
if (f == NULL)
{
printf ("\nfile opening error in listing :");

exit (1);
}

while (fread (&p, sizeof (p), 1, f) == 1)


{
printf ("\n\n\n YOUR RECORD IS\n\n ");
printf("\nName=%s\nAdress=%s\nFather name=%s\nMother
name=%s\nMobile no=%ld\nSex=%s\nE-mail=%s\nCitizen no=%s",
p.name, p.address, p.father_name, p.mother_name, p.mble_no, p.sex,p.mail,
p.citision_no);

getch ();

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

system ("cls");
}

fclose (f);
printf ("\n Enter any key");
getch ();
system ("cls");
menu ();
}

void
searchrecord ()
{
struct person p;
FILE *f;
char name[100];

f = fopen ("project", "rb");


if (f == NULL)
{
printf ("\n error in opening\a\a\a\a");
exit (1);

printf ("\nEnter name of person to search\n");


got (name);
while (fread (&p, sizeof (p), 1, f) == 1)
{
if (strcmp (p.name, name) == 0)
{
printf ("\n\tDetail Information About %s", name);
printf("\nName:%s\naddress:%s\nFather name:%s\nMother
name:%s\nMobile no:%ld\nsex:%s\nE-mail:%s\nCitision no:%s",p.name,
p.address, p.father_name, p.mother_name, p.mble_no,p.sex, p.mail,
p.citision_no);

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

Else
printf ("file not found");

fclose (f);
printf ("\n Enter any key");

getch ();
system ("cls");
menu ();
}

void
deleterecord ()
{
struct person p;
FILE *f, *ft;
int flag;
char name[100];
f = fopen ("project", "rb");
if (f == NULL)
{
printf ("CONTACT'S DATA NOT ADDED YET.");

}
else
{
ft = fopen ("temp", "wb+");
if (ft == NULL)

printf ("file opaning error");


else

{
printf ("Enter CONTACT'S NAME:");
got (name);

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

fflush (stdin);
while (fread (&p, sizeof (p), 1, f) == 1)
{
if (strcmp (p.name, name) != 0)
fwrite (&p, sizeof (p), 1, ft);
if (strcmp (p.name, name) == 0)
flag = 1;
}
fclose (f);
fclose (ft);
if (flag != 1)
{
printf ("NO CONACT'S RECORD TO DELETE.");
remove ("temp.txt");
}
else
{
remove ("project");
rename ("temp.txt", "project");
printf ("RECORD DELETED SUCCESSFULLY.");

}
}
}

printf ("\n Enter any key");

getch ();
system ("cls");
menu ();
}

void
modifyrecord ()
{
int c;

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

FILE *f;
int flag = 0;
struct person p, s;
char name[50];
f = fopen ("project", "rb+");
if (f == NULL)
{
printf ("CONTACT'S DATA NOT ADDED YET.");
exit (1);

}
else
{
system ("cls");
printf ("\nEnter CONTACT'S NAME TO MODIFY:\n");
got (name);
while (fread (&p, sizeof (p), 1, f) == 1)
{
if (strcmp (name, p.name) == 0)
{
printf ("\n Enter name:");
got (s.name);
printf ("\nEnter the address:");
got (s.address);
printf ("\nEnter father name:");
got (s.father_name);
printf ("\nEnter mother name:");
got (s.mother_name);
printf ("\nEnter phone no:");
scanf ("%ld", &s.mble_no);
printf ("\nEnter sex:");
got (s.sex);
printf ("\nEnter e-mail:");
got (s.mail);
printf ("\nEnter citizen no\n");
got (s.citision_no);
fseek (f, -sizeof (p), SEEK_CUR);

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

fwrite (&s, sizeof (p), 1, f);


flag = 1;
break;

fflush (stdin);

if (flag == 1)
{
printf ("\n your data id modified");

}
else
{
printf (" \n data is not found");

fclose (f);
}

printf ("\n Enter any key");


getch ();
system ("cls");
menu ();

void
got (char *name)
{
int i = 0, j;
char c, ch;
do

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

{
c = getch ();
if (c != 8 && c != 13)
{
*(name + i) = c;
putch (c);
i++;
}

if (c == 8)
{
if (i > 0)
{
i--;
}

// printf("h");
system ("cls");
for (j = 0; j < i; j++)
{
ch = *(name + j);
putch (ch);

}
}
}
while (c != 13);
*(name + i) = '\0';
}

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

EXPERIMENTAL RESULTS /OUTPUTs

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

CONCLUSION

Downloaded by Kunal Khatik ([email protected])


lOMoARcPSD|20973084

REFERENCES

• N.B. Venkateswarlu and E.V.Prasad, C and


data structures, S.Chand publishing,1st
Edition,2010.
• Reema Thareja, Programming in C, Oxford
University Press, 2nd Edition,2015.
• Stephen G.Kochan, Programming in C, Pearson
Education, 3rd Edition, 2005.
• PradeepDey, Manas Ghosh,Programming in C,
Oxford University Press, 2nd edition,2011.
• E Balagurusamy, Computer Programming,McGraw
Hill Education, 1st Edition.

Downloaded by Kunal Khatik ([email protected])

You might also like