FIRST YEAR – SEMESTER - II
Elective - II: PROGRAMMING IN C++ AND LAB
|
List of Programs |
|
1.
1. Write a class to represent a complex
number which has member functions to do the following a.
Set and show the
value of the complex number b.
Add, subtract and
multiply two complex numbers c.
Multiplying the
complex number with a scalar value 2.
Write a Point class
that represents a 2-d point in a plane. Write member functions to a.
Set and show the
value of a point b.
Find the distance
between two points c.
Check whether two
points are equal or not 3.
Design and implement
a Class to represent a Solid object. a.
Apart from data
members to represent dimensions, use a data member to specify the type of
solid. b.
Use functions to
calculate volume and surface area for different solids. 4.
Design a class
representing time in hh:mm:ss. Write functions to a.
Set and show the
time b.
Find the difference
between two time objects c.
Adding a given
duration to a time d.
Conversion of the
time object to seconds 5.
Design a 3x3 matrix
class and demonstrate the following: a.
Addition and
multiplication of two matrices using operator overloading b.
Maintaining a count
of the number of matrix object created 6.
Design a class
called cString to represent a string data type. Create a data member in the
class to represent a string using an array of size 100. Write the following
functionality as member functions: a.
Copy Constructor b.
Concatenate two
strings c.
Find the length of
the string d.
Reversing a string e.
Comparing two
strings 7.
Design a class
called cString to represent a string data type. Create a data member in the
class to represent a string whose size is dynamically allocated. Write the following
as member functions: a.
Copy Constructor b.
Destructor c.
Concatenate two
strings d.
Find the length of
the string e.
Reversing a string f.
Comparing two
strings |
No comments:
Post a Comment