Task 10
Task 10
Lab Manual 9
Write a program that can be used to assign seats for a commercial plane. The airplane has 13 rows, with
six seats in each row. Rows 1 and 2 are first class (seats range: 1-12), Rows 3 through 7 are business
class (seats range: 1-30) and rows 8 through 13 are economy class (seats range: 1-36). Your program
must prompt the user to enter the following information:
Here * indicates that seat is available and x indicates that seat is occupied.
Make this a menu-driven program, show the user’s choices and allow the user to make appropriate
choices.
Note:
• It is mandatory to implement double pointers and dynamic memory allocation concept in the
program. In other case your work will not be accepted.
• The best approach is to use the concept of classes and objects in the program.
PROBLEM NO.2
Create a class student that contains information about a student’s name,semester,roll no and date of
admission.
Provide
a) A no-argument constructor for initializing the value of data members to some defaults.
b) A 4-argument constructor to initialize the data members sent from the calling function at the
time of creation of an object(date should be sent from outside in the form of a date object).
Now derive a class undergraduate from student class that contains some additional information.
This information is about the semester gpa of a student and the credit points earned per semester
to store this data, provide a 2D array(2*8 array since at maximum there are 8 semesters for an
undergraduate program). One dimension of the array should hold information about the SGPA of
each semester so far and the other dimension should hold the corresponding credit points earned
in that semester.
a) Create a no-argument and a 5-argument constructor for data member initialization.
b) Provide overridden functions for getting and setting the data members
c) Provide another function to calculate the CGPA of the student on the basis of the information
provided by the 2D array.
Derive a class Graduate from student class that has same additional information as the
undergraduate class but in this case, the array is 2*4 sine at maximum there are four semesters in
graduate program. There are two additional data members: one to store the title of the last degree
held and another to store the area of specialization in graduate program. Provide appropriate
constructors and overridden member functions.
PROBLEM NO.3