Thursday, May 20, 2010

Generic programming

Share Orkut
22. Using generic programming concept, write function template for finding the minimum value in an array using bubble sort.

File manipulation

Share Orkut
21. Write a program will create a data file containing list of telephone numbers and implement the following task.
   a) Determine the telephone no of the specified person.
   b) Determine the name if a telephone no is known.
   c) Update the name and telephone no whenever there is change.

Pure Virtual Function

Share Orkut
20. Implement the base class polygon and derive triangle, rectangle and square classes from it. Implement functions to compute area and perimeter of the polygon. Use the concept of pure virtual functions.

Virtual Function

Share Orkut
19. Create a base class called student. Use the class to store the name, dob, rollno and includes member functions getdata(), displayresult(). Derive two class pg and ug from student. Make dispalyresult() as virtual function and redefine this function in the derived class to suite the requirements.

Multipath Inheritance

Share Orkut
18. Define a multipath inheritance structure in which the class master deserves information from both account and admin classes which in turn derive information from the class person. Define all four classes and write a program to create, update, and display the information contained in master objects.

Hybrid Inheritance

Share Orkut
17. Define a hybrid inheritance structures which will print the result as a cumulative score from test and sports. Each class should have its own constructors.

Wednesday, May 19, 2010

Hierarchical inheritance

Share Orkut
16. An educational system maintains a database of employees. The database is divided into a number of classes which defines a hierarchical inheritance structure. Specify all the classes and define functions to create the database and retrieve individual information required for each class.

Addition of two distances using friend function

Share Orkut
15. Create two classes MC and FI which stores values of distances. MC stores distance in meter and cm and FI stores in feet and inches. Write a program that reads and output the values of object of each class and use a friend function to carry out the addition of two distances and produce the result in FI type.

Class to class conversion

Share Orkut
14. Polar cordiantes are represented in angle and radius format while rectangular co-ordinates as(x,y). Define a class for both and write member functions to convert from polar to rectangular cordinates.

Basic to class and class to basic conversion

Share Orkut
13. A class representing distance measured in the unit of feet and inches. Write a program to do the conversion from meters to object of class type and object of class type to meters.

Operator functions as friend functions

Share Orkut
12. In a class distance is measured in feet and inches unit. Use operator overloading, + operator for adding two distances and < operator for comparing two distances(implement operator functions as friend functions).

Monday, May 17, 2010

Function overloading.

Share Orkut
11. Write a program to find the area of different shaped polygons like triangle, rectangle, square and circle using function overloading.

Static & Constant function

Share Orkut
10. Write a static member function for finding the average of a set of numbers. Use a constant function to display the value of average found.

Friday, May 14, 2010

User defined string functions

Share Orkut
9. Write a c++ program using classes to perform operations without using built in string functions. Member functions include
   a)Read the string
   b)Display the string
   c)Reverse the string
   d)Copy one string to another
   e)String concatenation

Complex numbers using operator overloading.

Share Orkut
8. Write a program to add, substract, divide, and multiply two complex numbers using operator overloading.

Inline function

Share Orkut
7. Write a inline function to compute the distance between 2 cordinates

Thursday, May 13, 2010

Add two time

Share Orkut
6. Write a program to implement the time class which has member data hour,minute,second. Constructors should get initial values. Member function should add two time variables and display the time in 11:59:59 format.

Differnt temprature scale(Farenheit/celsius/kelvin).

Share Orkut
5. Write a class that stores a temprature that can be specified in any of the differnt temprature scale(Farenheit/celsius/kelvin).

Students details- using class

Share Orkut
4. Write a program to read the details of a student (say name, age, gender, mark, attendence) and compute the total mark. Use class.

Students details- using structure

Share Orkut
3. Write a program to read the details students (say name, age, gender, mark, attendence) and compute the total mark. Use structures.

Check whether a date is valid or not

Share Orkut
2. Write a program to check whether a date entered by user is valid or not.

Wednesday, May 12, 2010

pass by value, pass by address, pass by refrence

Share Orkut
1. Write a program in c++ that ask the user to type 2 integer a & b and exchange the value of a & b using 
a)pass by value
b)pass by address
c)pass by refrence