About Me

header ads

C++ Basics (21EC482)

C++ Basics

Course Code 21EC482 
CIE Marks 50
Teaching Hours/Week (L: T:P: S) 0:0:2:0 
SEE Marks 50
Credits 1 
Exam Hours 03


Experiments

1 Write a C++ program to find largest, smallest & second largest of three numbers using inline functions MAX & Min.


2 Write a C++ program to calculate the volume of different geometric shapes like cube, cylinder and sphere using function overloading concept.


3 Define a STUDENT class with USN, Name & Marks in 3 tests of a subject. Declare an array of 10 STUDENT objects. Using appropriate functions, find the average of the two better marks for each student. Print the USN, Name & the average marks of all the students.


4 Write a C++ program to create class called MATRIX using two-dimensional array of integers, by overloading the operator == which checks the compatibility of two matrices to be added and subtracted. Perform the addition and subtraction by overloading + and – operators respectively. Display the results by overloading the operator <<. If (m1 == m2) then m3 = m1 + m2 and m4 = m1 – m2 else display error


5 Demonstrate simple inheritance concept by creating a base class FATHER with data members: First Name, Surname, DOB & bank Balance and creating a derived class SON, which inherits: Surname & Bank Balance feature from base class but provides its own feature: First Name & DOB. Create & initialize F1 & S1 objects with appropriate constructors & display the FATHER & SON details.


6 Write a C++ program to define class name FATHER & SON that holds the income respectively. Calculate & display total income of a family using Friend function.


7 Write a C++ program to accept the student detail such as name & 3 different marks by get_data() method & display the name & average of marks using display() method. Define a friend function for calculating the average marks using the method mark_avg().


8 Write a C++ program to explain virtual function (Polymorphism) by creating a base class polygon which has virtual function areas two classes rectangle & triangle derived from polygon & they have area to calculate & return the area of rectangle & triangle respectively.


9 Design, develop and execute a program in C++ based on the following requirements: An EMPLOYEE class containing data members & members functions: i) Data members: employee number (an integer), Employee_ Name (a string of characters), Basic_ Salary (in integer), All_ Allowances (an integer), Net_Salary (an integer). (ii) Member functions: To read the data of an employee, to calculate Net_Salary & to print the values of all the data members. (All_Allowances = 123% of Basic, Income Tax (IT) =30% of gross salary (=basic_ Salary_All_Allowances_IT).


10 Write a C++ program with different class related through multiple inheritance & demonstrate the use of different access specified by means of members variables & members functions.


11 Write a C++ program to create three objects for a class named count object with data members such as roll_no & Name. Create a members function set_data ( ) for setting the data values & display ( ) member function to display which object has invoked it using „this‟ pointer.


12 Write a C++ program to implement exception handling with minimum 5 exceptions classes including two built in exceptions.


Suggested Learning Resources:

1. Object oriented programming in TURBO C++, Robert Lafore, Galgotia Publications, 2002

2. The Complete Reference C++, Herbert Schildt, 4th Edition, Tata McGraw Hill, 2003.

3. Object Oriented Programming with C++, E Balaguruswamy, 4th Edition, Tata McGraw Hill, 2006.

Post a Comment

0 Comments