#include<stdio.h>
#include<conio.h>
#include <time.h>
struct student
{
char name[100];
int roll;
char program[20];
int fee;
int year;
int fees;
int fine;
int quizes;
int clas;
char tname[20];
char subname[20];
int pras;
int aver;
float a,b,c,d,e,f,total,quizes_aver,mid_aver,total_result,mid,final;
int choice,tmarks,wmarks,per;
}s;
char file[]="schools.bin";
void write();
int check(int a);
void read();
void delet();
void search();
void write2();
void attend();
void search_name();
void read_attendence();
void fee_recard();
void read_fee();
int cheach_fee();
int main()
{
while(1)
{
int i;
printf("\n\n\t\tYOU ARE ENTER IN UMT ATTENDENCE SHEET\n\n");
printf("\t..........................................................\n\n");
printf("if you want enter in the file then enter paswasrd\n");
scanf("%d",&i);
if(i!=10002)
printf("sorry your pasward is wrong \n\n");
else
{
while(1)
{
char c;
int i;
printf("\tslecte your choice\n");
printf("\t........................\n\n");
printf("\t\t1...for write attendence\n\n\t\t2....for read save record in the file\n \n\n\t\t3....for enter in new feld\n \n\n\t\t1...for delete recard\n \n\n\t\t2....for search roll number of the student\n \n\n\t\t4....for write complete information\n \n\n\t\t5....for write Attendence\n \n\n\t\t6....for read attendence\n \n\n\t\t7....for seach name of the student\n \n\n\t\t8....for fee software\n \n\n\t\t9....for read fee record\n");
scanf("%d",&c);
switch(c)
{
case 1:
write();
break;
case 2:
read();
break;
int l;
case 3:
printf("enter choice\n");
scanf("%d",&l);
switch(l)
{
case 1:
delet();
break;
case 2:
search();
break;
case 4:
write();
break;
case 5:
attend();
//getTimeAsFileName();
break;
case 6:
read_attendence();
//getTimeAsFileName();
break;
case 7:
search_name();
break;
case 8:
fee_recard();
break;
case 9:
read_fee();
break;
}
}
}
getch();
}
}
}
void write()
{
char n;
char result[100];
FILE *fp;
printf("\n\n\t\tenter student name\n");
fflush(stdin);
scanf("%s",s.name);
printf("\n\n\t\teneter student roll numbe\n");
fflush(stdin);
scanf("%d",&s.roll);
fp=fopen(file,"ab");
if(check(s.roll)!=1)
{
fwrite(&s,sizeof(s),1,fp);
}
else
printf("\n\n\t\tTHIS RECORD ALLREADY SAVE IN FILE\n\n\n......................................\n\n");
printf("\t\t\tPRESS any key if you want to contineous\n\t\t\t.....................\n\n\n");
fclose(fp);
}
int check(int a)
{
FILE *fp;
int flag=0;
struct student s;
fp=fopen(file,"rb");
while(fread(&s,sizeof(s),1,fp)==1)
{
if(s.roll==a)
{
flag=1;
return flag;
}
}
fclose(fp);
return flag;
}
void read()
{
FILE *fp;
fp=fopen(file,"rb");
while(fread(&s,sizeof(s),1,fp)==1)
{
printf("\n\n\n\t\t\tTHESE NAME SAVE IN YOUR FILE\n");
printf("\t............................................\n");
printf("name of the student=%s\n\nRoll number the student is=%d\n",s.name,s.roll);
printf("subject name= %s\n\n teacher name\n\n \n\n\tstudent name is=%s\n \n\n\troll number= %d\n-------------------------------------\nmarks in 1 quizes=%f\nmarks in 2 quizes=%f\nmarks in 3 quizes=%f\n marks in 4 quizes=%f\n marks in 5 quizes=%f\n marks in 6 quizes=%f\n total marks gain in 6 quizes=%f\n your choice is=%d\n total marks=%d\n your quizes average=%f\n marks in mid=%f\nyour percentage marks for mid%d\nwhole marks of mid%d\n mid term average%f\n marks in presentation=%d\n marks in final=%f\n marks in claspartisipation=%d\n total reult of this sudent is=%f\n \n\n\t\t-------------------------------------\n ",s.subname,s.tname,s.name,s.roll,s.a,s.b,s.c,s.d,s.e,s.f,s.total,s.choice,s.tmarks,s.quizes_aver,s.mid,s.per,s.wmarks, s.mid_aver,s.pras,s.final,s.clas,s.total_result);
}
printf(fp,"\n\n\tPRESS any key if you want to contineous\n\t\t\t.....................\n\n\n");
fclose(fp);
}
void delet()
{
int a;
FILE *fp,*fp1;
fp=fopen(file,"r");
fp1=fopen("b.bin","w");
printf("enter roll number fo delet recard\n");
scanf("%d",&a);
while(fread(&s,sizeof(s),1,fp)==1)
{
if(s.roll==a)
{
fwrite(&s,sizeof(s),1,fp1);
}
}
fclose(fp);
fclose(fp1);
if(remove(file)!=0)
printf("Error deleting file");
if(rename("b,bin",file)==0);
else{
printf("\n\n\t\t....file name change and first recard is delete\n");
}
}
void search()
{
FILE *fp;
int b;
fp=fopen(file,"rb");
printf("enter search roll\n");
fflush(stdin);
scanf("%d",&b);
while(fread(&s,sizeof(s),1,fp)==1)
{
if(s.roll==b){
printf("\n\n\t\t...Roll Number of The Student Is %d\n,",s.roll);
printf("\n\n\t\tName Of The Student Is %s\n\n\n",s.name);
}
}
fclose(fp);
}
void search_name()
{
FILE *fp;
char bn[20];
fp=fopen(file,"rb");
printf("enter search name\n");
fflush(stdin);
scanf("%s",bn);
while(fread(&s,sizeof(s),1,fp)==1)
{
if(strcmp(s.name,bn)==0){
printf("\n\n\t\tName Of The Student Is %s\n\n\n",s.name);
printf("\n\n\t\t...Roll Number of The Student Is %d\n,",s.roll);
}
}
fclose(fp);
}
void write2()
{
char n;
char result[100];
FILE *fp;
printf("enter subject name\n");
scanf("%s",s.subname);
printf("enter teachter name\n");
scanf("%s",s.tname);
printf("enter 1 quize marks\n");
scanf("%f",&s.a);
printf("enter 2 quize marks\n");
scanf("%f",&s.b);
printf("enter 3 quize marks\n");
scanf("%f",&s.c);
printf("enter 4 quize marks\n");
scanf("%f",&s.d);
printf("enter 5 quize marks\n");
scanf("%f",&s.e);
printf("enter 6 quize marks\n");
scanf("%f",&s.f);
s.total=s.a+s.b+s.c+s.d+s.e+s.f;
printf("%f total marks of quize\n",s.total);
printf("puting the values in this formula(total/tmarks) x choice; for quizes percentage\n");
printf("total marks of quies\n");
scanf("%d",&s.tmarks);
printf("enter your choice\n");
scanf("%d",&s.choice);
s.quizes_aver=(s.total/s.tmarks)*s.choice;
printf("%f\n",s.quizes_aver);
printf("total marks in mid\n");
scanf("%f",&s.mid);
printf("puting the values in this formula(mid/tmarks) x per; for quizes percentage\n");
printf("enter whole marks of mid\n");
scanf("%d",&s.wmarks);
printf("enter your percentage marks for mid\n");
scanf("%d",&s.per);
s.mid_aver=(s.mid/s.wmarks)*s.per;
printf("%f average of mid\n",s.mid_aver);
printf("total marks in assignment\n");
scanf("%d",&s.pras);
printf("total marls in final\n");
scanf("%f",&s.final);
printf("class partisipation marks\n");
scanf("%d",&s.clas);
s.total_result=s.quizes_aver+s.mid_aver+s.pras+s.final+s.clas;
printf("%f total result\n",s.total_result);
fp=fopen(file,"wb");
fprintf(fp,"subject name= %s\n\n teacher name\n\n \n\n\tstudent name is=%s\n \n\n\troll number= %d\n-------------------------------------\nmarks in 1 quizes=%f\nmarks in 2 quizes=%f\nmarks in 3 quizes=%f\n marks in 4 quizes=%f\n marks in 5 quizes=%f\n marks in 6 quizes=%f\n total marks gain in 6 quizes=%f\n your choice is=%d\n total marks=%d\n your quizes average=%f\n marks in mid=%f\nyour percentage marks for mid%d\nwhole marks of mid%d\n mid term average%f\n marks in presentation=%d\n marks in final=%f\n marks in claspartisipation=%d\n total reult of this sudent is=%f\n \n\n\t\t-------------------------------------\n ",s.subname,s.tname,s.name,s.roll,s.a,s.b,s.c,s.d,s.e,s.f,s.total,s.choice,s.tmarks,s.quizes_aver,s.mid,s.per,s.wmarks, s.mid_aver,s.pras,s.final,s.clas,s.total_result);
fwrite(&s,sizeof(s),1,fp);
fclose(fp);
}
void attend()
{
FILE *fp,*fp1;
char ch='p';
fp1=fopen("a,bin","ab");
fp=fopen(file,"rb");
while(fread(&s,sizeof(s),1,fp)==1)
{
printf("name of tne student is =%s\n,roll number of the student is %d\n\n\n",s.name,s.roll);
// printf("Enter P for persent and A for absenant %c :\n\n\n");
if(ch=='p')
ch=getch();
printf("%s= %c %d\n",s.name,ch);
}
// fwrite(&s,sizeof(s),1,fp1);
fclose(fp);
fclose(fp1);
}
void read_attendence()
{
char a;
FILE *fp1,*fp;;
char ch='p';
fp1=fopen("a,bin","rb");
fp=fopen(file,"rb");
while(fread(&s,sizeof(s),1,fp)==1)
{
printf("name of tne student is =%s\n,roll number of the student is %d\n\n\n",s.name,s.roll);
fflush(stdin);
// printf("%s= %c\n",s.name,ch);
a=fgetc(fp1);
printf("%s= %c %d\n",s.name,ch);
//fwrite(&s,sizeof(s),1,fp1);
//printf("%c\n",a);
}
fclose(fp);
fclose(fp1);
}
void fee_recard()
{
FILE *fp;
/// int a=100;
int year;
int date;
int fine;
int f2,f3,f4,f5,f6,f7,f8,f9,f10;
printf("enter student name \n");
fflush(stdin);
scanf("%s",s.name);
printf("enter student id\n");
fflush(stdin);
scanf("%d",&s.roll);
printf("enter student program\n");
fflush(stdin);
scanf("%s",s.program);
printf("enter student fee\n");
fflush(stdin);
scanf("%d",&s.fee);
printf("enter year\n");
fflush(stdin);
scanf("%d",&s.year);
printf("enter date \n");
fflush(stdin);
scanf("%d",&date);
fp=fopen(file,"ab");
fwrite(&s,sizeof(s),1,fp);
if(date<=10){
s.fees=605000-39100;
}
if(date==11){
s.fine=100+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==12){
s.fine=200+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==13){
s.fine=300+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==14){
s.fine=400+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==15) {
s.fine=500+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==16){
s.fine=600+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==17){
s.fine=700+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==18){
s.fine=800+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==19){
s.fine=900+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==20){
s.fine=1000+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==21){
s.fine=1100+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==22){
s.fine=1200+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==23){
s.fine=1300+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==24){
s.fine=1400+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==25){
s.fine=1500+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==26){
s.fine=1600+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==27){
s.fine=1700+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==28){
s.fine=1800+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==29){
s.fine=1900+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==30){
s.fine=2000+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date>=31)
{
printf("soory you are struck of from this university\n");
printf("because your late fee and get the permisson of the directer\n");
}
else
printf("This student already payed fee...............\n\n\n");
fclose(fp);
}
void read_fee()
{
FILE *fp;
fp=fopen(file,"rb");
while(fread(&s,sizeof(s),1,fp)==1)
{
printf(" name is = %s\n roll number=%d\n program =%s\n year is=%d\n fee with fine =%d\n fee without fine is=%d\n remmaning fee=%d\n",s.name,s.roll,s.program,s.year,s.fine,s.fee,s.fees);
printf("................YOUR RECARDs........................\n\n ");
}
fclose(fp);
}
#include<conio.h>
#include <time.h>
struct student
{
char name[100];
int roll;
char program[20];
int fee;
int year;
int fees;
int fine;
int quizes;
int clas;
char tname[20];
char subname[20];
int pras;
int aver;
float a,b,c,d,e,f,total,quizes_aver,mid_aver,total_result,mid,final;
int choice,tmarks,wmarks,per;
}s;
char file[]="schools.bin";
void write();
int check(int a);
void read();
void delet();
void search();
void write2();
void attend();
void search_name();
void read_attendence();
void fee_recard();
void read_fee();
int cheach_fee();
int main()
{
while(1)
{
int i;
printf("\n\n\t\tYOU ARE ENTER IN UMT ATTENDENCE SHEET\n\n");
printf("\t..........................................................\n\n");
printf("if you want enter in the file then enter paswasrd\n");
scanf("%d",&i);
if(i!=10002)
printf("sorry your pasward is wrong \n\n");
else
{
while(1)
{
char c;
int i;
printf("\tslecte your choice\n");
printf("\t........................\n\n");
printf("\t\t1...for write attendence\n\n\t\t2....for read save record in the file\n \n\n\t\t3....for enter in new feld\n \n\n\t\t1...for delete recard\n \n\n\t\t2....for search roll number of the student\n \n\n\t\t4....for write complete information\n \n\n\t\t5....for write Attendence\n \n\n\t\t6....for read attendence\n \n\n\t\t7....for seach name of the student\n \n\n\t\t8....for fee software\n \n\n\t\t9....for read fee record\n");
scanf("%d",&c);
switch(c)
{
case 1:
write();
break;
case 2:
read();
break;
int l;
case 3:
printf("enter choice\n");
scanf("%d",&l);
switch(l)
{
case 1:
delet();
break;
case 2:
search();
break;
case 4:
write();
break;
case 5:
attend();
//getTimeAsFileName();
break;
case 6:
read_attendence();
//getTimeAsFileName();
break;
case 7:
search_name();
break;
case 8:
fee_recard();
break;
case 9:
read_fee();
break;
}
}
}
getch();
}
}
}
void write()
{
char n;
char result[100];
FILE *fp;
printf("\n\n\t\tenter student name\n");
fflush(stdin);
scanf("%s",s.name);
printf("\n\n\t\teneter student roll numbe\n");
fflush(stdin);
scanf("%d",&s.roll);
fp=fopen(file,"ab");
if(check(s.roll)!=1)
{
fwrite(&s,sizeof(s),1,fp);
}
else
printf("\n\n\t\tTHIS RECORD ALLREADY SAVE IN FILE\n\n\n......................................\n\n");
printf("\t\t\tPRESS any key if you want to contineous\n\t\t\t.....................\n\n\n");
fclose(fp);
}
int check(int a)
{
FILE *fp;
int flag=0;
struct student s;
fp=fopen(file,"rb");
while(fread(&s,sizeof(s),1,fp)==1)
{
if(s.roll==a)
{
flag=1;
return flag;
}
}
fclose(fp);
return flag;
}
void read()
{
FILE *fp;
fp=fopen(file,"rb");
while(fread(&s,sizeof(s),1,fp)==1)
{
printf("\n\n\n\t\t\tTHESE NAME SAVE IN YOUR FILE\n");
printf("\t............................................\n");
printf("name of the student=%s\n\nRoll number the student is=%d\n",s.name,s.roll);
printf("subject name= %s\n\n teacher name\n\n \n\n\tstudent name is=%s\n \n\n\troll number= %d\n-------------------------------------\nmarks in 1 quizes=%f\nmarks in 2 quizes=%f\nmarks in 3 quizes=%f\n marks in 4 quizes=%f\n marks in 5 quizes=%f\n marks in 6 quizes=%f\n total marks gain in 6 quizes=%f\n your choice is=%d\n total marks=%d\n your quizes average=%f\n marks in mid=%f\nyour percentage marks for mid%d\nwhole marks of mid%d\n mid term average%f\n marks in presentation=%d\n marks in final=%f\n marks in claspartisipation=%d\n total reult of this sudent is=%f\n \n\n\t\t-------------------------------------\n ",s.subname,s.tname,s.name,s.roll,s.a,s.b,s.c,s.d,s.e,s.f,s.total,s.choice,s.tmarks,s.quizes_aver,s.mid,s.per,s.wmarks, s.mid_aver,s.pras,s.final,s.clas,s.total_result);
}
printf(fp,"\n\n\tPRESS any key if you want to contineous\n\t\t\t.....................\n\n\n");
fclose(fp);
}
void delet()
{
int a;
FILE *fp,*fp1;
fp=fopen(file,"r");
fp1=fopen("b.bin","w");
printf("enter roll number fo delet recard\n");
scanf("%d",&a);
while(fread(&s,sizeof(s),1,fp)==1)
{
if(s.roll==a)
{
fwrite(&s,sizeof(s),1,fp1);
}
}
fclose(fp);
fclose(fp1);
if(remove(file)!=0)
printf("Error deleting file");
if(rename("b,bin",file)==0);
else{
printf("\n\n\t\t....file name change and first recard is delete\n");
}
}
void search()
{
FILE *fp;
int b;
fp=fopen(file,"rb");
printf("enter search roll\n");
fflush(stdin);
scanf("%d",&b);
while(fread(&s,sizeof(s),1,fp)==1)
{
if(s.roll==b){
printf("\n\n\t\t...Roll Number of The Student Is %d\n,",s.roll);
printf("\n\n\t\tName Of The Student Is %s\n\n\n",s.name);
}
}
fclose(fp);
}
void search_name()
{
FILE *fp;
char bn[20];
fp=fopen(file,"rb");
printf("enter search name\n");
fflush(stdin);
scanf("%s",bn);
while(fread(&s,sizeof(s),1,fp)==1)
{
if(strcmp(s.name,bn)==0){
printf("\n\n\t\tName Of The Student Is %s\n\n\n",s.name);
printf("\n\n\t\t...Roll Number of The Student Is %d\n,",s.roll);
}
}
fclose(fp);
}
void write2()
{
char n;
char result[100];
FILE *fp;
printf("enter subject name\n");
scanf("%s",s.subname);
printf("enter teachter name\n");
scanf("%s",s.tname);
printf("enter 1 quize marks\n");
scanf("%f",&s.a);
printf("enter 2 quize marks\n");
scanf("%f",&s.b);
printf("enter 3 quize marks\n");
scanf("%f",&s.c);
printf("enter 4 quize marks\n");
scanf("%f",&s.d);
printf("enter 5 quize marks\n");
scanf("%f",&s.e);
printf("enter 6 quize marks\n");
scanf("%f",&s.f);
s.total=s.a+s.b+s.c+s.d+s.e+s.f;
printf("%f total marks of quize\n",s.total);
printf("puting the values in this formula(total/tmarks) x choice; for quizes percentage\n");
printf("total marks of quies\n");
scanf("%d",&s.tmarks);
printf("enter your choice\n");
scanf("%d",&s.choice);
s.quizes_aver=(s.total/s.tmarks)*s.choice;
printf("%f\n",s.quizes_aver);
printf("total marks in mid\n");
scanf("%f",&s.mid);
printf("puting the values in this formula(mid/tmarks) x per; for quizes percentage\n");
printf("enter whole marks of mid\n");
scanf("%d",&s.wmarks);
printf("enter your percentage marks for mid\n");
scanf("%d",&s.per);
s.mid_aver=(s.mid/s.wmarks)*s.per;
printf("%f average of mid\n",s.mid_aver);
printf("total marks in assignment\n");
scanf("%d",&s.pras);
printf("total marls in final\n");
scanf("%f",&s.final);
printf("class partisipation marks\n");
scanf("%d",&s.clas);
s.total_result=s.quizes_aver+s.mid_aver+s.pras+s.final+s.clas;
printf("%f total result\n",s.total_result);
fp=fopen(file,"wb");
fprintf(fp,"subject name= %s\n\n teacher name\n\n \n\n\tstudent name is=%s\n \n\n\troll number= %d\n-------------------------------------\nmarks in 1 quizes=%f\nmarks in 2 quizes=%f\nmarks in 3 quizes=%f\n marks in 4 quizes=%f\n marks in 5 quizes=%f\n marks in 6 quizes=%f\n total marks gain in 6 quizes=%f\n your choice is=%d\n total marks=%d\n your quizes average=%f\n marks in mid=%f\nyour percentage marks for mid%d\nwhole marks of mid%d\n mid term average%f\n marks in presentation=%d\n marks in final=%f\n marks in claspartisipation=%d\n total reult of this sudent is=%f\n \n\n\t\t-------------------------------------\n ",s.subname,s.tname,s.name,s.roll,s.a,s.b,s.c,s.d,s.e,s.f,s.total,s.choice,s.tmarks,s.quizes_aver,s.mid,s.per,s.wmarks, s.mid_aver,s.pras,s.final,s.clas,s.total_result);
fwrite(&s,sizeof(s),1,fp);
fclose(fp);
}
void attend()
{
FILE *fp,*fp1;
char ch='p';
fp1=fopen("a,bin","ab");
fp=fopen(file,"rb");
while(fread(&s,sizeof(s),1,fp)==1)
{
printf("name of tne student is =%s\n,roll number of the student is %d\n\n\n",s.name,s.roll);
// printf("Enter P for persent and A for absenant %c :\n\n\n");
if(ch=='p')
ch=getch();
printf("%s= %c %d\n",s.name,ch);
}
// fwrite(&s,sizeof(s),1,fp1);
fclose(fp);
fclose(fp1);
}
void read_attendence()
{
char a;
FILE *fp1,*fp;;
char ch='p';
fp1=fopen("a,bin","rb");
fp=fopen(file,"rb");
while(fread(&s,sizeof(s),1,fp)==1)
{
printf("name of tne student is =%s\n,roll number of the student is %d\n\n\n",s.name,s.roll);
fflush(stdin);
// printf("%s= %c\n",s.name,ch);
a=fgetc(fp1);
printf("%s= %c %d\n",s.name,ch);
//fwrite(&s,sizeof(s),1,fp1);
//printf("%c\n",a);
}
fclose(fp);
fclose(fp1);
}
void fee_recard()
{
FILE *fp;
/// int a=100;
int year;
int date;
int fine;
int f2,f3,f4,f5,f6,f7,f8,f9,f10;
printf("enter student name \n");
fflush(stdin);
scanf("%s",s.name);
printf("enter student id\n");
fflush(stdin);
scanf("%d",&s.roll);
printf("enter student program\n");
fflush(stdin);
scanf("%s",s.program);
printf("enter student fee\n");
fflush(stdin);
scanf("%d",&s.fee);
printf("enter year\n");
fflush(stdin);
scanf("%d",&s.year);
printf("enter date \n");
fflush(stdin);
scanf("%d",&date);
fp=fopen(file,"ab");
fwrite(&s,sizeof(s),1,fp);
if(date<=10){
s.fees=605000-39100;
}
if(date==11){
s.fine=100+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==12){
s.fine=200+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==13){
s.fine=300+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==14){
s.fine=400+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==15) {
s.fine=500+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==16){
s.fine=600+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==17){
s.fine=700+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==18){
s.fine=800+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==19){
s.fine=900+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==20){
s.fine=1000+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==21){
s.fine=1100+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==22){
s.fine=1200+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==23){
s.fine=1300+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==24){
s.fine=1400+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==25){
s.fine=1500+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==26){
s.fine=1600+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==27){
s.fine=1700+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==28){
s.fine=1800+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==29){
s.fine=1900+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date==30){
s.fine=2000+s.fee;
s.fees=605000-39100;
printf(" fee with fine=%d\n",s.fine);
printf("total fee with out file =%d\n",s.fees);
}
if(date>=31)
{
printf("soory you are struck of from this university\n");
printf("because your late fee and get the permisson of the directer\n");
}
else
printf("This student already payed fee...............\n\n\n");
fclose(fp);
}
void read_fee()
{
FILE *fp;
fp=fopen(file,"rb");
while(fread(&s,sizeof(s),1,fp)==1)
{
printf(" name is = %s\n roll number=%d\n program =%s\n year is=%d\n fee with fine =%d\n fee without fine is=%d\n remmaning fee=%d\n",s.name,s.roll,s.program,s.year,s.fine,s.fee,s.fees);
printf("................YOUR RECARDs........................\n\n ");
}
fclose(fp);
}