Explain about new and delete keywords with code.
Explain the type of polymorphism with code.
Grade ‘A’ for> 80% marks, ‘B’ for 70 to 80%, ‘C’ for 60 to 70%, D for 50 to 60%, F for <50%.
Base on above information, do the following:
(i) Write a function which prints the name and grades of all students in the ascending order of the
grades. In case of same grade, print all respective names in alphabetical order.
(ii) Write a function which prints the name and grades of all students in the alphabetical order of
the name of the students.
(iii) Write a function to search the grade of a student based on the first name of the student. In
case of multiple entries with same name, print all the names with roll number and respective
grades.
Here, consider Student as a base class whose derived classes are T1T2T3, P1P2, and Attendance.
Further, consider the class Total which inherits the classes T1T2T3, P1P2, and Attendance as
multiple inheritance. Classes Faculty and Administration are independent classes
Let we have to prepare the final result of each student for a particular subject. The final
marks are sum of marks obtained by the student in T1, T2, T3, P1, P2, and attendance in theory class. Let
there are following classes:Apart from that, there are two other classes:
(a) Faculty: which have no data member but have a member function to assign the marks of T1,
T2, T3, P1, P2, and percentage of attendance to each student.
(b) Administration: which have no data member but have member functions to enter the name
and roll number of each student, and to calculate the total marks and final grade of each student.
Grade ‘A’ for> 80% marks, ‘B’ for 70 to 80%, ‘C’ for 60 to 70%, D for 50 to 60%, F for <50%.
Explain about new and delete keywords with code
What is difference b/w type conversion and type casting explain with code
Explain the type of polymorphism with code
Create a class named 'Member' having the following members:
Data members
1 - Name
2 - Age
3 - Phone number
4 - Address
5 - Salary
It also has a method named 'printSalary' which prints the salary of the members.
Two classes 'Employee' and 'Manager' inherits the 'Member' class. The 'Employee' and 'Manager'
classes have data members 'specialization' and 'department' respectively. Now, assign name, age,
phone number, address and salary to an employee and a manager by making an object of both of these
classes and print the same.
Given a MxN matrix,write a program to print all Anti-Diagonals elements of matrix
The first line of input will contain a M, N values separated by space.
The second line will contain matrix A of dimensions MxN.
The output should contain anti-diagonal elements separated by a line.
For example, if M = 4, N = 4
Matrix A:
Input :
2 3
1 5 5
2 7 8
Output must be
1
5 2
5 7
8
the output must be like this only without any extra messages
Implement a template class Stack data structure for stack operations such as Full() and Empty() with exception handling. Note: Use templates with exception handling and size of stack is set to 5.
* Print: "An stack overflow exception occurred!" or "An stack empty exception occurred!"