Sunday, October 14, 2007

C++ Programmes

  1. WAP to find greatest of three numbers using conditional operator.
  2. WAP to find greatest of three numbers using if statement only.
  3. WAP to find sum of digit.
  4. WAP to check whether a given String is palindrome or not.
  5. WAP to store/show employee information (Name, age, address) in structure.
  6. WAP to demonstrator concept of nested structure.
  7. WAP to compare two strings using user defined functions.
  8. WAP to demonstrate how we can print structure value using pointers
  9. WAP to find length of a string using user defined function
  10. WAP to compare two strings using user defined function
  11. WAP to copy a string
  12. . WAP to demonstrate use of access specifier in classes
  13. . WAP to demonstrate an array of bank acc object where acc class consist of acno, name and balance as data members
  14. . WAP to demonstrate passing of an object by value
  15. WAP to demonstrate passing of an object by address
  16. WAP to add two matrices by returning as object form a function using classes and objects
  17. WAP that calculate total number of object created.
  18. WAP to enter time in hours, minutes and seconds and display time in universal format (2:00 pm =14:00)
  19. WAP to generate fibonacci series using object.
  20. WAP to calculate distance between two points using constructors. If (x1,y1) and (x2,y2) are two points then distance between them is:
    D=√(x2-x1)2+(y2-y1)2
  21. WAP to implement basic operation of stack using class
  22. WAP to add two times and display output in proper format
  23. Write a class Box with its data members width, length and height. Initialize data members using default, parameterized and copy constructors and calculate volume of the box.
  24. WAP to overload increment operator for prefix and postfix increment on time class
  25. WAP to overload comparison operator == for strings
  26. WAP to overload >= operator for date object
  27. WAP to demonstrate operator overloading for unary operator using friend functions
  28. WAP to demonstrate operator overloading for binary operator using friend functions
    29. WAP to demonstrate concept of friend functions
    30. WAP to demonstrate friend function act as bridge between two different classes
    31. WAP to show how we can create dynamic objects
    32. WAP to create an array of dynamic object
    33. WAP to demonstrate how to declare entire class as a friend of another class
    34. WAP to demonstrate the concept of overriding
    35. WAP to demonstrate public, private and protected inheritance
    36. WAP to calculate result of students using private inheritance
    37. WAP to demonstrate multilevel and multiple inheritance
    38. WAP to demonstrate hybrid inheritance
    39. WAP to show behavior of constructor in multiple and multilevel inheritance
    40. Design an application for hospital management system. For this create the following classes and members
    Person(name, dob, sex)
    Doctor(specialization)
    Patient(Caseno, disease, doadmin, dodis, billno)
    Write functions to input data from user and display data to user
  29. Design a railway traffic control system. Where TRAIN is a Base class for PASSENGER_TRAIN and GOODS_TRAIN classes. Each class contain following members:
    TRAIN( TrainNo, Source, Destination, NoOfBogies)
    PASSENGER_TRAIN(NoOfPassengerPerBogy)
    GOODS_TRAIN(LoadingCapacityPerBogy)
    Write functions to get data from user and display to user
  30. WAP to demonstrate the behavior of parameterized constructor in multilevel inheritance
  31. WAP to demonstrate #define, #include, #if, #else, #endif, #ifdef #undef
  32. WAP to sum of two number using #define

7 comments:

Unknown said...

create class
class class_name
{
private:
Data_type private_data;
public:
date_type public data

Private:
private functions;
public fuunction
}

Unknown said...

please explain memory allocation
in objects??

Unknown said...

please explain memory allocation
in objects??

Sonia Sharma said...
This comment has been removed by the author.
Sonia Sharma said...

W.A.P. to swap two number with functions.

void main()
{
void swap(float *a, float *b)
float value1,value2;
clrscr();
printf("\n enter the numbers=");
scanf("%f%f",&value1,value2);
printf("before swaping =");
printf("value1=%.2f value2=%.2f",value1,value2);
swap(&value1,&value2);
printf("\n after swaping =");
printf("\n value1=%.2f value2=%.2f",value1,value2);
getch();
}
void swap (float *a, float *b)
{
float temp;
temp=*a;
*a=*b;
*b=temp;
return;
}

Sonia Sharma said...

good evening sir;
this box is not accepting heater files in their symbols means
HTML tags

Gurpreet Singh Kamboj said...

hi, try this
// conditional operator


int main ()
{
int a,b,c;

a=2;
b=7;
c = (a>b) ? a : b;

cout << c;

return 0;
}