Lab Assignment-2 (Week-2) : 1. Name 2. Roll No 3. Degree 4. Hostel 5. Currentcgpa
Lab Assignment-2 (Week-2) : 1. Name 2. Roll No 3. Degree 4. Hostel 5. Currentcgpa
Q1. Create a class containing the details of Students as details below and a main
function to test the class:
Data Members(properties):
1. Name
2. Roll No
3. Degree
4. Hostel
5. CurrentCGPA
Member Function(behavior):
1. addDetails();
2. updateDetails();
3. updateCGPA();
4. updateResidenceInfo();
5. displaydetails();
Q2. Define a class named Complex with properties (real and imaginary) and methods
as per following details.
void set (float, float) to initialize object values.
void display () to display complex number.
Complex sum (Complex) to add two complex numbers (objects of Complex class) and
return complex number (object of Complex class) as result.
properties (real and imaginary) of the code should have private access modifier and
member functions should have public access modifier in C++ class
Q3. Create code snippets that illustrates the use of scope resolution operator (: :) for the
following uses: