Program to find applicable Fees of a student

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
class candidate
{
long int admno;
char name[20];
char category;
float fees;
void afees()
{
if(category==’G’)
fees=5000;
else if(category==’F’)
fees=7500;
else if(category==’S’||category==’T’)
fees=2500;
}
public:
void input()
{
cout<<“enter admission number of the candidate “;
cin>>admno;
cout<<“enter candidate`s name “;
gets(name);
cout<<“enter his category “;
cout<<“among G, F, S, or T “;
cin>>category;
afees();
}
void output()
{
cout<<“\nas per entered details”;
cout<<“\nadmission number of the candidate is “<<admno;
cout<<“\ncandidate`s name “<<name;
cout<<“\nfees appliciable as per the category “<<fees;
}
};
void main()
{
clrscr();
candidate C1;
C1.input();
C1.output();
getch();
}

Comments

Popular Posts