GE1a Programming Using C++
GE1a Programming Using C++
2022
Generic Elective
GE – 1a: Programming using C++
S. Referenc
Unit Name Chapters Weeks
No. es
1, 2 [2]
1. Unit 1 Introduction to C++ Pg 10 – 17 [1] 1–3
Pg 20 – 22 [3]
Essential/recommended readings
1. Stephen Prata, C++ Primer Plus, 6th Edition, Pearson India, 2015.
2. E. Balaguruswamy, Object Oriented Programming with C++,8th edition, McGraw-Hill
Education, 2017.
3. D.S. Malik, C++ Programming: From Problem Analysis to Program Design, 6th edition,
Cengage Learning, 2013
1. Write a program to compute the sum of the first n terms of the following series:
𝑆 = 1 − 2 + 3 – 4 + ... + n
The number of terms n is to be taken from the user.
6. Create a class Triangle. Include overloaded functions for calculating the area of a triangle.
7. Create a template class TwoDim which contains x and y coordinates. Define default
constructor, parameterized constructor and void print() function to print the coordinates.
Now reuse this class in ThreeDim adding a new dimension as z. Define the constructors
and void print() in the subclass. Implement main() to demonstrate the use of these classes.