Академический Документы
Профессиональный Документы
Культура Документы
AUGMENTED EXPERIMENT
AIM: To create a file on the basis of the student fee management system
INTRODUCTION:
In this experiment we are learning about the how the the data of a student fee management can be
stored in one file
At first we have to give some student details as input for the programme, as per the following details
1)Student name
3)address of student
4) father name
7) total fee
By giving these student details our file is created as per the student details, then after compiling the
programme then we have to show the list of students as their fee due or not .we can also the how much
fee due is there or every student and also by using these process we can solve the due remaining also
.just as simple by entering the student roll number we get the student details also (or) we can also check
(or) view the student details by also entering the student name .we can also calculate the pending fee
details only by entering the roll number.
PROGRAMME:
#include<stdio.h>
#include<conio.h>
void main()
struct fee
{ int r_no;
char name[40];
char add[40];
char f_name[40];
char stream[40];
};
struct fee f;
char stream[40];
int r_no;
fp=fopen("FEE2.DAT","rb+");
if(fp==NULL)
{
fp=fopen("FEE2.DAT","wb+");
if(fp==NULL)
exit(1);
recsize = sizeof(f);
while(1)
clrscr();
gotoxy(30,10);
gotoxy(30,12);
gotoxy(30,14);
gotoxy(30,16);
gotoxy(30,18);
gotoxy(30,20);
printf("0.Exit");
gotoxy(30,22);
printf("Your choice");
fflush(stdin);
choice = getche();
switch(choice)
case '1':
fseek(fp,0,SEEK_END);
another = 'Y';
printf("\nEnter Roll_no");
scanf("%d", &f.r_no);
printf("\nEnter Name");
scanf(" %s",f.name);
printf("\nEnter Address");
scanf("%s",f.add);
scanf("%s",f.f_name);
scanf("%ld", &f.d_fee);
printf("\nEnter Stream");
scanf("%s",f.stream);
fflush(stdin);
another = getche();
break;
case '2':
clrscr();
rewind(fp);
getch();
break;
case '3':
another='Y';
while(another=='Y')
scanf("%d",&r_no);
scanf("%s",stream);
rewind(fp);
flag=0;
if((f.r_no==r_no)&&(strcmp(f.stream,stream)==0))
{
if(f.d_fee<=total)
flag=1;
scanf("%ld",&amount);
f.d_fee=f.d_fee + amount;
fwrite(&f,recsize,1,fp);
break;
}}
if(flag==0)
getch();
fflush(stdin);
another=getche();
break;
case '4':
another='Y';
while(another=='Y')
{
printf("\nEnter roll number to check pending amount");
scanf("%d",&r_no);
scanf("%s",stream);
rewind(fp);
flag=0;
flag=1;
if((f.r_no==r_no)&&(strcmp(f.stream,stream)==0))
pending=total-f.d_fee;
f.d_fee=f.d_fee+pending;
getch();
if(flag==0)
getch();
fflush(stdin);
another=getche();
}
break;
case '5':
another='Y';
while(another=='Y')
scanf("%d",&r_no);
ft = fopen("TEMP.DAT","wb");
rewind(fp);
if(f.r_no!=r_no)
fclose(fp);
fclose(ft);
remove("FEE2.DAT");
rename("TEMP.DAT", "FEE2.DAT");
fp=fopen("FEE2.DAT", "rb+");
fflush(stdin);
another = getche();
break;
case '0':
fclose(fp);
exit();
}}