Professional Documents
Culture Documents
h>
#include <fstream.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <conio.h>
#include <dos.h>
#include <iomanip.h>
int i,j,li,lp,rec,valid;
void help();
char ch,choice;
class FEE
{
private :
int Class ;
float tuition, ac, science, computer, activity ;
void DISPLAY(int) ;
void MODIFY_RECORD(int, float, float, float, float, float) ;
public :
void ADDITION(void) ;
void MODIFICATION(void) ;
void FEE_SLIP(void) ;
void LIST(void) ;
void HELP(void);
}fee ;
void mainmenu()
{ clrscr();
gotoxy(15,10);
cout<<"\ nPress the corresponding Keys for the desired action";
gotoxy(35,13);
cprintf("\n M: MODIFY");
gotoxy(35,19);
cprintf("\n Q: QUIT");
choice=getch();
ch=toupper(choice);
switch(ch)
{
case'F':fee.FEE_SLIP();
break;
case'M':fee.MODIFICATION();
break;
case'Q':exit(0);
break;
default:gotoxy(33,40);
cout<<"\nIllegal Choice Press any key to return to Main Menu";
getch();
mainmenu();
}
}
//**********************************************************
// FUNCTION TO ADD FEE STRUCTURE IN FEE FILE
//**********************************************************
//**********************************************************
// FUNCTION TO DISPLAY THE RECORD FOR THE GIVEN CLASS
//**********************************************************
//**********************************************************
// FUNCTION TO MODIFY THE FEE RECORD FOR THE GIVEN DATA
//**********************************************************
//**********************************************************
// FUNCTION TO GIVE DATA TO MODIFY THE FEE RECORD
//**********************************************************
//**********************************************************
// FUNCTION TO DISPLAY THE FEE SLIP FOR THE CLASS
//**********************************************************
valid = 0 ;
gotoxy(5,25) ; clreol() ;
cout <<"\n7Enter correctly" ;
getch() ;
}
} while (!valid) ;
char name[26] ;
do
{
gotoxy(5,25) ; clreol() ;
cout <<"\nENTER NAME OF THE STUDENT" ;
valid = 1 ;
gotoxy(5,7) ; clreol() ;
cout <<"\nName : " ;
gets(name) ;
if (strlen(name) < 1 || strlen(name) > 25)
{
valid = 0 ;
gotoxy(5,25) ; clreol() ;
cout <<"\nNAME SHOULD NOT BE GREATER THAN 25" ;
getch() ;
}
} while (!valid) ;
clrscr() ;
cout <<"\n ST FRANCIS INTER COLLEGE " ;
int d1, m1, y1 ;
struct date dt;
getdate(&dt);
d1 = dt.da_day ;
m1 = dt.da_mon ;
y1 = dt.da_year ;
cout <<"\n Date: " <<d1 <<"/" <<m1 <<"/" <<y1 ;
cout <<"\n NAME : " <<name ;
cout <<"\n CLASS : " <<tclass ;
cout <<"\n PARTICULARS AMOUNT" ;
fstream file ;
file.open("FEE.DAT", ios::in) ;
while (file.read((char *) this, sizeof(FEE)))
if (Class == tclass)
break ;
file.close() ;
float total=0.0 ;
cout <<"\n\n\n Tuition fees " <<setprecision(2)
<<tuition ;
total = total+tuition ;
cout <<"\n Annual charges fees " <<setprecision(2)
<<ac ;
total = total+ac ;
cout <<"\n Science fees " <<setprecision(2)
<<science ;
total = total+science ;
cout <<"\n Computer fees " <<setprecision(2)
<<computer ;
total = total+computer ;
cout <<"\n Activity fees " <<setprecision(2)
<<activity ;
total = total+activity ;
char tt[15] ;
sprintf(tt,"%f",total) ;
cout <<"\n Total " <<tt ;
cout<<"\n Cashier" ;
cout<<"\n Press any key to return to the main menu........";
getch() ;
mainmenu();
}
//**********************************************************
// MAIN FUNCTION TO CREATE MENU AND CALL OTHER FUNCTIONS
//**********************************************************
void main()
{
FEE fee;
fee.ADDITION();
clrscr();