Answer to Question #259187 in C++ for Chiran

Question #259187

You are required to develop a simple result sheet generator for an Advanced level class.


Assume that class consists of 30 students and each student follows a subject. Implement your


result sheet generator as a menu driven C++ application. Your program should read 30 students


marks from the keyboard and print mark, grade sheet and summary sheet as per the details


given below.


i. Draw a top-level design diagram for the above problem.

1
Expert's answer
2021-10-30T23:56:17-0400
#include <iostream>
using namespace std; 
#define MAX 10
class student
{
    private:
        char  name[30];
        int   grade;
    public:
        void obtainDetails(void);
        void enterDetails(void);
        void summDetails(void);
};
void student::obtainDetails(void){
    cout << "Enter name: " ;
    cin >> name;
    cout << "Enter marks: ";
    cin >> grade;
}
void student::enterDetails(void){
    cout<<grade<<endl;
}
void student::summDetails(void){
	cout << "Name:"<< name <<"       grades:" <<grade<<endl;
}
 
int main()
{
    student std[MAX];   
    int num,loop;
     
    cout << "Enter total number of students: ";
    cin >> num;
     
    for(loop=0;loop< num; loop++){
        std[loop].obtainDetails();
    }
     
    cout << endl;
     cout<<"Grade sheet"<<endl;
    for(loop=0;loop< num; loop++){
        
        std[loop].enterDetails();
    }
    cout<<"Summary sheet"<<endl;
      for(loop=0;loop< num; loop++){
        
        std[loop].summDetails();
    }
    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