Covid Vaccine registration booth:
1. frontline fighter
2. Citizen over 40 years
3. Student
Candidate info:
1.Name
2.Category
3.Registration no
4. Priority (age)
5. Age
Operation:
1. Registration
2. Show candidate list
3. Search candidate
using queue
#include <iostream>
using namespace std;
#define MAX 5
class student
{
private:
string name;
int rollNo;
int total;
float perc;
public:
void getDetails(void){
cout << "Enter name: " ;
cin >> name;
cout << "Enter roll number: ";
cin >> rollNo;
cout << "Enter total marks outof 500: ";
cin >> total;
perc=(float)total/500*100;
}
void putDetails(void){
cout << "Student details:\n";
cout << "Name:"<< name << ",Roll Number:" << rollNo << ",Total:" << total << ",Percentage:" << perc;
}
};
int main()
{
student s[MAX];
int n,l;
cout << "Enter total number of students: ";
cin >> n;
for(l=0;l< n; l++){
cout << "Enter details of student " << l+1 << ":\n";
s[l].getDetails();
}
cout << endl;
for(l=0;l< n; l++){
cout << "Details of student " << (l+1) << ":\n";
s[l].putDetails();
}
return 0;
}
Comments
Leave a comment