[go: up one dir, main page]

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 25

DATA STRUCTURE USING ‘C’

MICRO PROJECT-PROPOSAL

ON

PHONE DIRECTORY APPLICATION USING DOUBLY-LINKED


LIST

1.0 Brief Introduction:

In computer science, a doubly linked list is a linked data structure that


consists of a set of sequentially linked records called nodes. Each node
contains three fields: two link fields (references to the previous and to the
next node in the sequence of nodes) and one data field. The beginning and
ending nodes' previous and next links, respectively, point to some kind of
terminator, typically a sentinel node or null, to facilitate traversal of the list.
If there is only one sentinel node, then the list is circularly linked via the
sentinel node. It can be conceptualized as two singly linked lists formed
from the same data items, but in opposite sequential orders.

Phone Directory can be efficiently implemented using Trie Data Structure.


We insert all the contacts into Trie.

Generally, search query on a Trie is to determine whether the string is


present or not in the trie, but in this case we are asked to find all the strings
with each prefix of ‘str’. This is equivalent to doing a DFS traversal on a
graph. From a Trie node, visit adjacent Trie nodes and do this recursively
until there are no more adjacent. This recursive function will take 2
arguments one as Trie Node which points to the current Trie Node being
visited and other as the string which stores the string found so far with prefix
as ‘str’.
Each Trie Node stores a Boolean variable ‘is Last’ which is true if the node
represents end of a contact(word).
2.0 Aim of the Micro-Project:

 Save the data in file.


 Add numbers, delete number from the current list.
 Search & modify the given list

3.0 Intended Course Outcome:

 We define the problem on which we are working in the project.


 We understand the problem domain. the produce a model of the
system.

4.0 Literature Review:

The problem of determining a heuristic which maintains a doubly linked list


in approximately optimal order with respect to mean search time is
considered. Within a general framework of simple assumptions, it is shown
that in one particular case no such heuristic can be found, while in many
other situations heuristics for similarly maintaining sequential lists should be
used. In the remaining circumstances a heuristic known as move to end is
shown to reduce search time, on average, to at most twice the minimum
value determined by an optimal ordering of the list.

5.0 Proposed methodology:

1. Save numbers.

2. Can search and update the number.

3. When a number is off you can delete it from your directory.

4. Can see all the list any time.


6.0 Resources Required:

No Name of Specifications Quantity Remarks


resources/material
1. Software Turbo C++ - 1
,Microsoft
world
2. Operating system Windows 8.1 - 2

7.0 Action plan:

No Detail of Planned Planned Team of responsible


activity start date finish member
date
1. Information Girish Desai
collection
2. Proposal Sanskruti Bhakare
creation
3. Report Sanskruti Bhakare & Girish
creation Desai
MICRO PROJECT REPORT

ON

DATA STRUCTURE USING ‘C’


Title of Micro-Project: Phone Directory Application

1.0 Brief Description:

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

2.0 Aim of Micro Project:

The aim of developing the Art Gallery database are as given below: -
 To store data of the entire user who are registered in the site.
 To solve the user’s problem in time efficient manner. Helping the user
to search different Art with a robust search tools.
 To facilitate easy and efficient retrieval of data as and when required
for Art by the user.

3.0 Course Outcomes Integrated:

Outcome 1: Creative Process

Students will be able to use a variety of brainstorming techniques to generate


novel ideas of value to solve problems.

Outcome 2: Development of Skill and Technique

Students will have sufficient mastery of one or more media to complete the
technical and formal challenges pertinent to a body of original work.

Outcome 3: Development of Context and Concept

Students will be able to develop ideas that are relevant and responsive to the
world around them.

Outcome 4: Communication of Ideas and Context


Students will be able to clearly communicate the content, context, and
process of their work visually, orally and in writing.

4.0 Actual Procedure Followed:

First, we discussed in group about to find the subject related to


project. After discussion finally, we select the topic, the topic is Online Art
Gallery Management System. Then we collect information related to subject.
Afterwards, according to the standard format we started to do the work on
project. The group members decided to do work separately in ways like
collecting information, making proposal & report.

Mr. Sajid Momin Sir, guide us how to collect the information & how
to work on the subject. According to his guidance we followed the rule and
after collecting information our project is completed. Finally, our project is
successfully completed. As per the decision of all members complete the
given work.

5.0 Actual Resources Used:

Sr. No. Name of Specifications Quantity Remarks


Resource/material

1. Software Oracle, 1
Microsoft
-Word

2. Operating system Window 10 1


6.0 Outputs of the Micro-projects:

Design specification:

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;

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;

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);

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.mai
l,p.citision_no);

getch();

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.mai
l,p.citision_no);

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);

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;

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);

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

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';

}
OUTPUT:
7.0 Skill Developed/ learning out of this Micro-Project:

Time Management.
Stress Management.
Study Skills.
Money Management.
Assertiveness Skills.
Well-Developed Self Care Skills.
Keeping Safe and Avoiding Risky Behaviors.
Seeking Assistance When Needed.

You might also like