Академический Документы
Профессиональный Документы
Культура Документы
2015-2018
Submitted by Guided by
RISHABH REHANI Mr. A.K-Srivastav
0151BCA043
New Delhi-63
2016
Acknowledgement
CERTIFICATE OF ORIGINALITY
CERTIFICATE OF ORIGINALITY
This is to certify that the Project titled is an academic work done by RISHABH
REHANI submitted in the partial fulfilment of the requirement for the award
of the Degree of Bachelor of Computer Application from Bharati
Vidyapeeth Deemed University, Pune under my guidance & direction. To
the best of my knowledge and belief the data & information presented by
him/her in the project has not been submitted earlier.
Mr. A.K-Srivastav
DECLARATION
I have not submitted this work anywhere else for any other degree or diploma.
All sources of information and help are authentic and have been acknowledged
in the report.
RISHABH REHANI
INTERNAL CERTIFICATE
Mr. A.K-Srivastav
Key features:
Front-end : C language
Back-end : C language
Problem definition
Modules Implemented/Designed
Add Record
List Record
Modify Record
Delete Record
Search Record
Close Record
Add Record : Addition of records must always take place at the end of
existing records in the file.
List Record : Listing records means displaying the existing records on the
screen.
Modify Record: While modyfing records, first we must ask the user
which record he intends to modify. On modifying the record, the existing
record gets overwritten by the new record.
Delete Record:
b) Then the original file must be deleted and the temporary file must be
renamed back to original.
d) Close_Record : File is being opened only once and closed only once.
g) fread() always reads that record where the pointer is currently placed.
h) fwrite() always writes the record where the pointer is currently placed
i) The rewind() function places the pointer to the beginning of the file,
irrespective of where it is present right now.
j) The fseek() function moves the pointer from one record to another.
CODING
/*
* @language: C
*/
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<string.h>
#include<dos.h>
char password[10]={"hello"};
char ch,pass[10];
int i=0,j;
clrscr();
gotoxy(10,4);
for(j=0;j<20;j++)
delay(10);
printf("*");
for(j=0;j<20;j++)
delay(10);
printf("%c",d[j]);
for(j=0;j<20;j++)
delay(10);
printf("*");
gotoxy(10,10);
gotoxy(15,7);
printf("Enter Password:");
while(ch!=13)
ch=getch();
putch('*');
pass[i] = ch;
i++;
pass[i] = '\0';
if(strcmp(pass,password)==0)
gotoxy(15,9);
printf("Password match");
gotoxy(17,10);
getch();
else
gotoxy(15,16);
getch();
Password();
int main(){
int j;
struct emp{
};
* if the file EMP.DAT already exists then it open that file in read write mode
*/
textcolor(GREEN);
Password();
fp = fopen("z1.dat","rb+");
if(fp == NULL){
fp = fopen("z1.dat","wb+");
if(fp == NULL){
exit(1);
recsize = sizeof(e);
while(1){
textcolor(BLUE);
gotoxy(20,3); /// move the cursor to postion 30, 10 from top-left corner
cprintf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2
MAIN MENU
\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2");
gotoxy(20,5);
gotoxy(20,7);
gotoxy(20,9);
gotoxy(20,11);
gotoxy(20,13);
gotoxy(20,15);
cprintf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\x
B2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\x
B2\xB2\xB2\xB2\xB2\xB2\xB2\n");
gotoxy(20,17);
switch(choice){
system("cls");
another = 'y';
scanf("%d",&e.id);
scanf("%s",e.name);
scanf("%d", &e.age);
scanf("%s",e.designation);
scanf("%f", &e.bs);
fflush(stdin);
another = getche();
break;
case '2':
//int j;
system("cls");
gotoxy(1,1);
cprintf("*********************************Employee
Details*****************************");
gotoxy(2,2);
j=4;
//fp=fopen("z.dat","rb+");
gotoxy(3,j);
cprintf("%d",e.id);
gotoxy(10,j);
cprintf("%s",e.name);
gotoxy(20,j);
cprintf("%d",e.age);
gotoxy(32,j);
cprintf("%s",e.designation);
gotoxy(52,j);
cprintf("%.2f",e.bs);
gotoxy(57,j);
cprintf("\n\n");
j++;
gotoxy(3,25);
// fclose(fp);
getch();
break;
system("cls");
another = 'y';
while(another == 'y'){
scanf("%s", empname);
rewind(fp);
scanf("%d",&e.id);
scanf("%s",e.name);
scanf("%d",&e.age);
scanf("%s",e.designation);
scanf("%f",&e.bs);
cprintf("\n **********Updation
sucessfull*************");
break;
if(strcmp(e.name,empname) != 0)
break;
fflush(stdin);
another = getche();
break;
case '4':
system("cls");
another = 'y';
while(another == 'y'){
scanf("%s",empname);
fclose(fp);
fclose(ft);
fp = fopen("z1.dat", "rb+");
fflush(stdin);
another = getche();
break;
case '5':