0% found this document useful (0 votes)
24 views

Lab Mid

The document describes a C++ class called MyClass that represents a college class with 10 students. MyClass contains arrays and pointers to store student names, grades, roll numbers, and the class name. It includes functions to set and get this data, as well as display the full class records or just students with grade A.

Uploaded by

Kumail Shah
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Lab Mid

The document describes a C++ class called MyClass that represents a college class with 10 students. MyClass contains arrays and pointers to store student names, grades, roll numbers, and the class name. It includes functions to set and get this data, as well as display the full class records or just students with grade A.

Uploaded by

Kumail Shah
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Object Oriented Programming Lab mid Term Class BESE20A Marks 20

(NOTE: Design of class should contain Function prototypes inside the class and definitions outside the class) Create a class called MyClass to represent one single class in a college having four data members an array of 10 char pointers named s_names to store student names, a char pointer to store grades of 10 students , an array of 10 int to store roll no and one char pointer c_name to store a class name. Class should have a default constructor that will perform the following four tasks: Set maximum size of each name to be 15 by dynamically creating all the ten pointers of s_names. Allocate ten characters locations dynamically to store grades using grade pointer. Initialize all the rollnos to 0. Initialize class name to space. Provide a member function setclassname that will receive value from main by user and set it to member c_name. Also provide public set member functions for each remaining members which will receive no parameters and will set values for each member using cin statement. Also provide only one public get function for member c_name. Provide a public function displayall () that will print the complete records including all students roll no, names, grades in column format labeled with the headings roll no, name and grade. Also print the class name on the top of the record by calling member function getclassname() in displayall() function at the top. Provide another function named top Students ( ) that will display the records of only those students that have grade A. If there is no such student then display message that no student in this class (class name) have grade A.

You might also like