This is an object oriented programming question The code should be in C++ language Create a class Student having a private data members S_ID, S_Name and S_CGPA. Now create a public member functions void getID(), void getName() and getCGPA() and finally to display all the data members, create a function void display(). In the main(), create an array of student class, size of the array should be taken from user at run time and call all the functions defined in the class. Sample Output: Student 1 Enter ID: 1 Enter Name: Ali Enter CGPA: 2.5 Student 2 Enter ID: 2 Enter Name: Ahmed Enter CGPA: 2.9 Student 3 Enter ID: 3 Enter Name: Zain Enter CGPA: 3.4 Student 1 information ID: 1 Name: Ali CGPA: 2.5 Student 2 information ID: 2 Name: Ahmed CGPA: 2.9 Student 3 information ID: 3 Name: Zain CGPA: 3.4
This is an object oriented programming question
The code should be in C++ language
Create a class Student having a private data members S_ID, S_Name and S_CGPA. Now create a public member functions void getID(), void getName() and getCGPA() and finally to display all the data members, create a function void display().
In the main(), create an array of student class, size of the array should be taken from user at run time and call all the functions defined in the class.
Sample Output:
Student 1
Enter ID: 1
Enter Name: Ali
Enter CGPA: 2.5
Student 2
Enter ID: 2
Enter Name: Ahmed
Enter CGPA: 2.9
Student 3
Enter ID: 3
Enter Name: Zain
Enter CGPA: 3.4
Student 1 information
ID: 1
Name: Ali
CGPA: 2.5
Student 2 information
ID: 2
Name: Ahmed
CGPA: 2.9
Student 3 information
ID: 3
Name: Zain
CGPA: 3.4
Step by step
Solved in 2 steps with 1 images