College Fees Management System in C++ [Code]
The College/Institute Fees Management System with Source Code is a final year project that can generate and manage the College/Institute fees for each student.
The College/Institute Fees Management System can list the total payment for tuition fees. The purpose of the College/Institute Fees Management System is to help and organize the total payment for the whole College/Institute fees.
The user can do only simple tasks in the College/Institute Fees Management System in the College/Institute Fees Management System, he/she can add new students, generate College/Institute fees, view the total fee to each class number. The College/Institute Fees Management System has all the necessary functions that can be used to generate College/Institute fees. The College/Institute Fees Management System is for educational purposes only, you are free to modify it as you fit your needs. All the user-entered data are stored as the data file extensions. This College/Institute Fees Management System is so simple to use that uses only basic CRUD functions to make things work according to its process.
The College/Institute Fees Management System was developed as a basic coding structure of C++ that can be easily understood by new programmers.
Functional Requirements of College Fees Management System
- The user can view, delete, update, insert, search a Fee Slip
- Modify
- List
- Help
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 |
#include <iostream> #include <windows.h> #include <fstream> #include <cstring> #include <cstdlib> #include <cstdio> #include <cctype> #include <conio.h> #include <ctime> #include <dos.h> #include <iomanip> using namespace std; int i,j,li,lp,rec,valid; COORD coord = {0, 0}; void gotoxy(int x, int y) { COORD coord; coord.X = x; coord.Y = y; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord); } void help(); char ch,choice; class DRAW { public : void LINE_HOR(int, int, int, char) ; void LINE_VER(int, int, int, char) ; void BOX(int,int,int,int,char) ; } ; 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 ; //**************************************** // MAIN MENU FUNCTION //**************************************** void mainmenu() { system("cls"); for(li=30;li<=50;li++) { gotoxy(li,14); Sleep(30); printf("*"); } for(li=50;li>=30;li--) { gotoxy(li,30); Sleep(30); printf("*"); } for(lp=15;lp<30;lp++) { gotoxy(30,lp); Sleep(100); printf("|"); } for(lp=29;lp>=15;lp--) { gotoxy(50,lp); Sleep(100); printf("|"); } gotoxy(15,10); printf("Press the corresponding Keys for the desired action.."); gotoxy(35,16); printf("F: FEE SLIP"); gotoxy(35,19); printf("M: MODIFY"); gotoxy(35,22); printf("L: LIST"); gotoxy(35,25); printf("H: HELP"); gotoxy(35,28); printf("Q: QUIT"); choice=getch(); ch=toupper(choice); switch(ch) { case'F':fee.FEE_SLIP(); break; case'M':fee.MODIFICATION(); break; case'L':fee.LIST(); break; case'H':fee.HELP(); break; case'Q':exit(0); break; default:gotoxy(33,40); cout<<"Illegal Choice Press any key to return to Main Menu"; getch(); mainmenu(); } } //Main Menu Function End //************************************ // FUNCTION TO DRAW HORIZONTAL LINE //************************************ void DRAW :: LINE_HOR(int column1, int column2, int row, char c) { for ( column1; column1<=column2; column1++ ) { gotoxy(column1,row) ; cout <<c ; } } //********************************************************** // FUNCTION TO DRAW VERTICAL LINE //********************************************************** void DRAW :: LINE_VER(int row1, int row2, int column, char c) { for ( row1; row1<=row2; row1++ ) { gotoxy(column,row1) ; cout <<c ; } } //********************************************************** // FUNCTION TO DRAW BOX LINE //********************************************************** void DRAW :: BOX(int column1, int row1, int column2, int row2, char c) { char ch=218 ; char c1, c2, c3, c4 ; char l1=196, l2=179 ; if (c == ch) { c1=218 ; c2=191 ; c3=192 ; c4=217 ; l1 = 196 ; l2 = 179 ; } else { c1=c ; c2=c ; c3=c ; c4=c ; l1 = c ; l2 = c ; } gotoxy(column1,row1) ; cout <<c1 ; gotoxy(column2,row1) ; cout <<c2 ; gotoxy(column1,row2) ; cout <<c3 ; gotoxy(column2,row2) ; cout <<c4 ; column1++ ; column2-- ; LINE_HOR(column1,column2,row1,l1) ; LINE_HOR(column1,column2,row2,l1) ; column1-- ; column2++ ; row1++ ; row2-- ; LINE_VER(row1,row2,column1,l2) ; LINE_VER(row1,row2,column2,l2) ; } //********************************************************** // FUNCTION TO ADD FEE STRUCTURE IN FEE FILE //********************************************************** void FEE :: ADDITION(void) { fstream file ; file.open("FEE.DAT", ios::in) ; if (!file.fail()) return ; file.close() ; file.open("FEE.DAT", ios::app) ; for (int i=1; i<=12; i++) { Class = i ; tuition = 0.0 ; ac = 0.0 ; science = 0.0 ; computer= 0.0 ; activity= 0.0 ; file.write((char *) this, sizeof(FEE)) ; } file.close() ; MODIFY_RECORD(12,450,50,60,60,50) ; MODIFY_RECORD(11,450,50,60,60,50) ; MODIFY_RECORD(10,350,50,30,60,50) ; MODIFY_RECORD(9,350,50,20,60,50) ; MODIFY_RECORD(8,300,50,20,40,50) ; MODIFY_RECORD(7,300,50,20,40,50) ; MODIFY_RECORD(6,300,50,20,40,50) ; MODIFY_RECORD(5,250,50,0,40,40) ; MODIFY_RECORD(4,250,50,0,40,40) ; MODIFY_RECORD(3,250,50,0,40,40) ; MODIFY_RECORD(2,250,50,0,40,40) ; MODIFY_RECORD(1,250,50,0,40,40) ; } //********************************************************** // FUNCTION TO DISPLAY TOTAL FEE AS LIST //********************************************************** void FEE :: LIST() { system("cls") ; DRAW d ; // textcolor(MAGENTA); d.BOX(1,2,80,24,218) ; gotoxy(27,3) ; cout <<"TOTAL FEES FOR THE CLASSES" ; d.LINE_HOR(2,79,4,196) ; gotoxy(5,5) ; cout <<"CLASS TOTAL FEES" ; d.LINE_HOR(2,79,6,196) ; d.LINE_HOR(2,79,22,196) ; float total ; int row=8 ; fstream file ; file.open("FEE.DAT", ios::in) ; while (file.read((char *) this, sizeof(FEE))) { total = tuition + ac + science + computer + activity ; gotoxy(6,row) ; cout <<Class ; gotoxy(23,row) ; cout <<total ; row++ ; } file.close() ; gotoxy(5,23) ; cout <<"Press any key to continue............." ; getch() ; mainmenu(); } //********************************************************** // FUNCTION TO DISPLAY THE RECORD FOR THE GIVEN CLASS //********************************************************** void FEE :: DISPLAY(int tclass) { fstream file ; file.open("FEE.DAT", ios::in) ; while (file.read((char *) this, sizeof(FEE))) { if (Class == tclass) { gotoxy(5,5) ; cout <<"Class : " <<Class ; gotoxy(5,7) ; cout <<"~~~~~~~~~~~~" ; gotoxy(5,8) ; cout <<"Tution Fee : " <<tuition ; gotoxy(5,9) ; cout <<"Annual charges Fee : " <<ac ; gotoxy(5,10) ; cout <<"Science Fee : " <<science ; gotoxy(5,11) ; cout <<"Computer Fee: " <<computer ; gotoxy(5,12) ; cout <<"Activity Fee : " <<activity ; break ; } } file.close() ; } //********************************************************** // FUNCTION TO MODIFY THE FEE RECORD FOR THE GIVEN DATA //********************************************************** void FEE :: MODIFY_RECORD(int tclass, float ttution, float tac, float tscience, float tcomputer, float tactivity) { fstream file ; file.open("FEE.DAT", ios::in) ; fstream temp ; temp.open("temp.dat", ios::out) ; file.seekg(0,ios::beg) ; while (!file.eof()) { file.read((char *) this, sizeof(FEE)) ; if (file.eof()) break ; if (tclass == Class) { Class = tclass ; tuition = ttution ; ac = tac ; science = tscience ; computer= tcomputer ; activity= tactivity ; temp.write((char *) this, sizeof(FEE)) ; } else temp.write((char *) this, sizeof(FEE)) ; } file.close() ; temp.close() ; file.open("FEE.DAT", ios::out) ; temp.open("temp.dat", ios::in) ; temp.seekg(0,ios::beg) ; while (!temp.eof()) { temp.read((char *) this, sizeof(FEE)) ; if (temp.eof()) break ; file.write((char *) this, sizeof(FEE)) ; } file.close() ; temp.close() ; } //********************************************************** // FUNCTION TO GIVE DATA TO MODIFY THE FEE RECORD //********************************************************** void FEE :: MODIFICATION(void) { system("cls") ; char ch, t1[10] ; int valid=0, t=0, tclass=0 ; float t2=0 ; do { valid = 1 ; gotoxy(5,25) ; cout <<"Press <ENTER> for EXIT" ; gotoxy(5,5) ; cout <<"Enter Class for the Modification of the Fee Structure : " ; gets(t1) ; t = atoi(t1) ; tclass = t ; if (strlen(t1) == 0) return ; if (tclass < 1 || tclass > 12) { valid = 0 ; gotoxy(5,25) ; cout <<"Enter correctly" ; getch() ; } } while (!valid) ; system("cls") ; gotoxy(71,1) ; cout <<"<0>=Exit" ; DISPLAY(tclass) ; gotoxy(5,25) ; do { gotoxy(5,15) ; cout <<"Do you want to modify the fee structure (y/n) : " ; ch = getche() ; if (ch == '0') return ; ch = toupper(ch) ; } while (ch != 'N' && ch != 'Y') ; if (ch == 'N') mainmenu(); float ttution=0.0, tac=0.0, tscience=0.0, tcomputer=0.0, tactivity=0.0 ; gotoxy(5,13) ; gotoxy(5,17) ; cout <<"Tuition Fee : " ; gotoxy(5,18) ; cout <<"Annual Charges Fee : " ; gotoxy(5,19) ; cout <<"Science Fee : " ; gotoxy(5,20) ; cout <<"Computer Fee : " ; gotoxy(5,21) ; cout <<"Activity Fee : " ; int modified = 5 ; fstream file ; file.open("FEE.DAT", ios::in) ; while (file.read((char *) this, sizeof(FEE))) if (Class == tclass) break ; file.close() ; do { valid = 1 ; gotoxy(5,27) ; cout <<"Enter TUITION FEE or Press <ENTER> for no change" ; gotoxy(19,17) ; gets(t1) ; t2 = atof(t1) ; ttution = t2 ; if (t1[0] == '0') return; if (strlen(t1) == 0) break ; if (ttution > 1000) { valid = 0 ; gotoxy(5,27) ; cout <<"7Enter correctly" ; getch() ; } } while (!valid) ; if (strlen(t1) == 0) { modified-- ; ttution = tuition ; gotoxy(20,17) ; cout <<ttution ; } do { valid = 1 ; gotoxy(5,27) ; cout <<"Enter ANNUAL CHARGES fee or Press <ENTER> for no change" ; gotoxy(26,18) ; gets(t1) ; t2 = atof(t1) ; tac = t2 ; if (t1[0] == '0') return ; if (strlen(t1) == 0) break ; if (tac > 1000) { valid = 0 ; gotoxy(5,27) ; cout <<"7Enter correctly" ; getch() ; } } while (!valid) ; if (strlen(t1) == 0) { modified-- ; tac = ac ; gotoxy(26,18) ; cout <<tac ; } do { valid = 1 ; gotoxy(5,27) ; cout <<"Enter SCIENCE FEES or Press <ENTER> for no change" ; gotoxy(19,19) ; gets(t1) ; t2 = atof(t1) ; tscience = t2 ; if (t1[0] == '0') return ; if (strlen(t1) == 0) break ; if (tscience > 1000) { valid = 0 ; gotoxy(5,27) ; cout <<"7Enter correctly" ; getch() ; } } while (!valid) ; if (strlen(t1) == 0) { modified-- ; tscience = science ; gotoxy(19,19) ; cout <<tscience ; } do { valid = 1 ; gotoxy(5,27) ; cout <<"Enter COMPUTER FEES or Press <ENTER> for no change" ; gotoxy(19,20) ; gets(t1) ; t2 = atof(t1) ; tcomputer = t2 ; if (t1[0] == '0') return ; if (strlen(t1) == 0) break ; if (tcomputer > 1000) { valid = 0 ; gotoxy(5,27) ; cout <<"7Enter correctly" ; getch() ; } } while (!valid) ; if (strlen(t1) == 0) { modified-- ; tcomputer = computer ; gotoxy(19,20) ; cout <<tcomputer ; } do { valid = 1 ; gotoxy(5,27) ; cout <<"Enter ACTIVITY FEES or Press <ENTER> for no change" ; gotoxy(19,21) ; gets(t1) ; t2 = atof(t1) ; tactivity = t2 ; if (t1[0] == '0') return; if (strlen(t1) == 0) break; if (tactivity > 1000) { valid = 0 ; gotoxy(5,27) ; cout <<"7Enter correctly" ; getch() ; } } while (!valid) ; if (strlen(t1) == 0) { modified-- ; tactivity = activity ; gotoxy(19,21) ; cout <<tactivity ; } if (!modified) mainmenu(); gotoxy(5,27) ; do { gotoxy(5,25) ; cout <<"Do you want to save (y/n) : " ; ch = getche() ; if (ch == '0') return ; ch = toupper(ch) ; } while (ch != 'N' && ch != 'Y') ; if (ch == 'N') return ; MODIFY_RECORD(tclass,ttution,tac,tscience,tcomputer,tactivity); gotoxy(5,27) ; cout <<"7Record Modified" ; gotoxy(5,29) ; cout <<"Press any key to continue..........." ; getch() ; mainmenu(); } //********************************************************** // FUNCTION TO DISPLAY THE FEE SLIP FOR THE CLASS //********************************************************** void FEE :: FEE_SLIP(void) { system("cls") ; char ch, t1[10] ; int valid=0, t=0, tclass=0 ; do { valid = 1 ; gotoxy(5,25) ; cout <<"Press <ENTER> for EXIT" ; gotoxy(5,5) ; cout <<"Enter Class to see the Fee Structure : " ; gets(t1) ; t = atoi(t1) ; tclass = t ; if (strlen(t1) == 0) return ; if (tclass < 1 || tclass > 12) { valid = 0 ; gotoxy(5,25) ; cout <<"7Enter correctly" ; getch() ; } } while (!valid) ; char name[26] ; do { gotoxy(5,25) ; cout <<"ENTER NAME OF THE STUDENT" ; valid = 1 ; gotoxy(5,7) ; cout <<"Name : " ; gets(name) ; if (strlen(name) < 1 || strlen(name) > 25) { valid = 0 ; gotoxy(5,25) ; cout <<"NAME SHOULD NOT BE GREATER THAN 25" ; getch() ; } } while (!valid) ; system("cls") ; DRAW d ; d.BOX(20,2,61,24,987) ; gotoxy(24,3) ; cout <<" YOUR SCHOOL " ; int d1, m1, y1 ; time_t td = time(0); struct tm * now = localtime( & td ); d1 = now->tm_mday ; m1 = (now->tm_mon +1 ) ; y1 = (now->tm_year +1900 ); gotoxy(45,4) ; cout <<"Date: " <<d1 <<"/" <<m1 <<"/" <<y1 ; d.LINE_HOR(21,60,5,196) ; gotoxy(22,6) ; cout <<"NAME : " <<name ; gotoxy(22,7) ; cout <<"CLASS : " <<tclass ; d.LINE_HOR(21,60,8,196) ; gotoxy(21,9) ; cout <<" PARTICULARS AMOUNT" ; d.LINE_HOR(21,60,10,196) ; d.LINE_HOR(21,60,22,196) ; d.LINE_HOR(46,60,20,196) ; gotoxy(25,21) ; cout <<"TOTAL" ; gotoxy(54,23) ; cout <<"CASHIER" ; fstream file ; file.open("FEE.DAT", ios::in) ; while (!file.eof()) { file.read((char *) this, sizeof(FEE)); if (Class == tclass) { cout<<"found"<<endl; break ; } file.close() ; } float total=0.0 ; gotoxy(23,12) ; cout <<"Tuition fees " <<setprecision(2) <<tuition ; total = total+tuition ; gotoxy(23,13) ; cout <<"Annual charges fees " <<setprecision(2) <<ac ; total = total+ac ; gotoxy(23,14) ; cout <<"Science fees " <<setprecision(2) <<science ; total = total+science ; gotoxy(23,15) ; cout <<"Computer fees " <<setprecision(2) <<computer ; total = total+computer ; gotoxy(23,16) ; cout <<"Activity fees " <<setprecision(2) <<activity ; total = total+activity ; d.LINE_VER(9,21,46,179) ; char tt[15] ; sprintf(tt,"%f",total) ; gotoxy(49,21) ; cout <<tt ; gotoxy(33,40); cout<<"Press any key to return to the main menu........"; getch() ; mainmenu(); } void FEE::HELP() { system("cls"); cout<<"This is a fee structure program"<<endl; cout<<"It can be used to : "<<endl; cout<<"1. View the fee slip of a student of a class"<<endl; cout<<"2. Modify the fee structure of the school"<<endl; cout<<"3. View the fee structure of the school in the form of alist"<<endl; cout<<"The menu functions are described as follows"<<endl; cout<<"1. FEE SLIP: This function displays the fee slip for a givenstudent"<<endl; cout<<" from the class entered by the user. "<<endl; cout<<"2. MODIFY: This function modifies the fee structure for a give class."<<endl; cout<<" The user can change the fees for various fields"<<endl; cout<<"3. LIST: This function displays the list of total fees for all the"<<endl; cout<<"Press any key to continue..........."<<endl; getch(); mainmenu(); } //********************************************************** // MAIN FUNCTION TO CREATE MENU AND CALL OTHER FUNCTIONS //********************************************************** int main() { FEE fee; fee.ADDITION(); system("cls"); for(i=10;i<71;i++) { gotoxy(i,15); Sleep(30); printf("/"); } for(i=70;i>=10;i--) { gotoxy(i,22); Sleep(30); cout<<" / "; } for(j=16;j<=21;j++) { gotoxy(10,j); Sleep(100); printf("-"); } for(j=21;j>=16;j--) { gotoxy(70,j); Sleep(100); printf("-"); } gotoxy(16,17); printf("School Fees Management System"); gotoxy(12,20); printf(" "); printf(" Press Any Key To ..........Continue"); getch(); mainmenu(); return 0; } |
Download Source Code of College Fees Management System in C++ [Code]