Answer the following problems
Describe the term Class and Object using ex of a student class. Student class represents name, enrolment number, father’s name, telephone number, programme code and date of birth of a student. The class has the function to illustrate the information about student except date of birth, and to modify information of telephone number and programme. Name the private and public members (data members as well as member functions) for the class student. Define the data types of member variables using C++ and create few objects of the class. Could you put information in those objects? Give reasons.
Describe the following terms in context of object oriented programming using student class of problem 1. You should use C++ to define student class. Additionally, suppose that student class has a sub class namely “PhD Student” who has the extra field “Department”. The function to describe the information about PhD student also prints department in addition to showing information as shown by the student class.
(a) Overloaded Constructors
prepare down the advantages of using UML? Create class diagram for a University having classes – Student, Teacher, Subject and Programme. Make appropriate assumptions, if any.
Describe the usage of the following C++ operators with the help of the ex program.
(a) operator for type casting
(b) operator for bitwise OR
(c) operator for dereferencing an address
(d) comma operator
Differentiate between call by value and call by reference with the help of an ex in content of function call. Describe the advantages of call by value. What does C++ uses?
prepare down the template class “binaryTree” in C++. The class must have functions for search and insert and element into a binaryTree. Use this template to make a binary tree of integer keys. Make appropriate assumptions, if any.
Create a class AlphaString which stores only alphabets in a string of arbitrary length. String has a constructor which ensures that String has only Alphabets. Class also has the copy constructor, and an overloaded + operator. The overloaded + operator must perform concatenation of two strings. Does the class need an explicit destructor? Justify your answer.