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

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter12: Adding Functionality To Your Classes
Section12.2: Providing Class Conversion Capabilities
Problem 6E
icon
Related questions
Question

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

 

 

 

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,