Вы находитесь на странице: 1из 4

C++ Programs List

1. Write a Program to read a set of names, roll number, date of birth and date of admission of the students in a
school from the keyboard where the date of birth and date of admission consists of 3 members such as day,
month and year as a separate structure and to sort them in ascending order using a structure
2. WAP to perform the following (using menu) arithmetic operations of a complex number using a structure.
a. Addition
b. Subtraction
c. Multiplication
d. Division
3. WAP with a function that intakes 2 date(day, month,year) structures and returns the structure with later date
4. Define a class to represent a bank account:
Data members
a. name of the depositor
b. Account number
c. Type of account
d. Balance amount in the account
Member functions
a. To assign initial values
b. To deposit an amount
c. To withdraw an amount after checking the balance
d. To display name and balance
5. Define a class student with the following specifications:
Private members of class student
a. adno integer
b. name 25 character
c. marks(5 subjects) float
d. ctotal() function to calculate total with float return type
Public member functions
get() fn. to accept values for adno, name, marks and invoke ctotal to calculate total
e. grade() The percentage marks and grade are to be calculated from the above info. Grade is calculated
as follows.
f. percentage marks
grade
g. < 50
F
>=50 < 60
D
>=60 < 75
C
>=75 < 90
B
>=90 < 100
A
show() display all data members on the screen

6. Illustrate inline function


7. Illustrate friend function
8. Illustrate constructor overloading
9. Perform operations (+,-,*./) on complex data using class and object
10. Write a Program to illustrate the use of objects as arguments to function using Pass-by-value Mechanism to add
two time
( Hint :
class Time
{
int hours;
int minutes;
int seconds;
..
..
};
11. Display in proper time format ( eg: 11:03 AM)
12. Illustrate the use of friend function
13. Illustrate the friend function as bridges
14. Illustrate static class member and static member function
15. Illustrate a friend class
16. Illustrate function overloading
17. Illustrate the use of this pointer
18. Illustrate the usage of the pointers to derived objects
19. Illustrate multiple inheritance
20. Illustrate single inheritance
21. Illustrate multilevel inheritance
22. Illustrate hierarchical inheritance

23. Illustrate hybrid inheritance


24. Illustrate the order of the execution of constructors and destructors
25. Illustrate the order of the execution of constructors and destructors for multipath
26. Illustrate virtual base class
27. Overload the unary operator
28. overload the binary operator
a+=b (hint: return this)
a+=5 (hint : friend)
29. overload ->,[ ],() and comma ( , )
30. WAP to demonstrate how function overloading is carried out for swapping of 2 variables of the various data types,
namely integers, floating point numbers and character types.
31. Write an object oriented prog. in C++ that prints the factorial of a given number using a constructor and a
destructor member function
32. WAOOP in C++ that determines whether a given number is prime or not using default constructor and a
destructor
33. WAOOP in C++ to read an integer number and find the sum of all the digits until it reduces to single digit using a
constructor, destructor or default constructor
34. WAP to read a set of numbers and store it in an one-dimensional array, again read a number 'd' and check
whether the number 'd' is present in the array or not. If it is so, print out how many times the no. d is repeated in
the array using new and delete operators
35. WAP using operator overloading for the numbers to perform simple arithmetic operations that has the functions to
add, subtract, multiply and divide
36. WAP using operator overloading to overload < operator and display the smallest number out of 2 objects.
37. WAP using operator overloading to overload = operator. Assign values
another object of the same type.

of data members of one object to

38. Illustrate virtual function


39. Illustrate pure virtual function
40. WAP to invoke member functions of base and derived classes using pointer of base class.
41. WAP to define a function template for summing an array of integers, floating point numbers, double
42. WAP illustrates the overloaded function templates with different number of parameters to compute the areas of
circle, triangle
43. WAP to create template based stack . Store integer and float in it (numbers=5)
44. WAP to illustrate multi path inheritance
45. Illustrate a class template
46. Illustrate a template class with 3 generic data types
47. WAP to display the elements of integer and float array using template variables with member function
48. WAP to sort integer and float array elements using bubble sort method
49. WAP illustrates the overloaded function templates with different number of parameters to compute the areas of
rectangle, square.
50. WAP to declare virtual function and execute the same fn defined in base and derived classes
51. WAP that finds the size of a file
52. WAP that merges two files to a single file
53. Exception handling 1 divide 0
54. Exception handling 2 root imginary no
55. Exception handling 3

Вам также может понравиться