C++ Project on Student Registration
Features
- Add Student
- Generate Reports
Source Code
//header files
#include
#include
#include
using namespace std;
/*
this function add student record to text file
Argument1: filename
Argument2: Pointer to studentCount
*/
void addStudent(string filename, int *studentCount, int *inStateFees, int *outStateFees){
cout<>state;
if(state==1)
file<<" | In-State";
else if(state==2)
file<<" | Out-Of-State";
else
file<<" | NA";
int tutionFees;
cout<>tutionFees;
char choice;
cout<>choice;
int healthPlan = 0;
if(choice=='Y' || choice=='y'){
char plan;
cout< $40";
cout< $160";
cout< $120";
cout< $200";
cout<>plan;
switch(plan){
case 'E':
case 'e': healthPlan = 40; break;
case 'S':
case 's': healthPlan = 160; break;
case 'C':
case 'c': healthPlan = 120; break;
case 'F':
case 'f' : healthPlan = 200; break;
default: cout<>choice;
switch(choice){
case 1: addStudent(fileName, &studentCount, &inStateFees, &outStateFees);
break;
case 2: generateReport(fileName, &studentCount, &inStateFees, &outStateFees);
break;
case -1: cout<