Answer to Question #213858 in C++ for robiul

Question #213858

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


1
Expert's answer
2021-07-07T01:53:46-0400


#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS