Page 59 - C++
P. 59

};
                             const int size=10;
                             class CQUEUE
                             {
                                    Player  Ar[size];
                                    int  Front, Rear;
                                 public:
                                    CQUEUE( )
                                    {
                                          Front = -1;
                                          Rear = -1;
                                    }
                                    void Ins_Player();   // To add player in a static circular queue
                                    void Del_Player(); // To remove player from a static circular queue
                                    void Show_Player(); // To display static circular queue
                             };

                                                                OR

                      (d)    Write a function in C++ to delete a node containing Books information
                             ,from a dynamically allocated stack of Books implemented with the help of
                             the following structure:
                             struct Book
                             {
                             int BNo;
                             char BName[20];
                             Book *Next;
                             };

                      (e)    Convert the following Infix expression to its equivalent Postfix expression,  (2)
                             showing the stack contents for each step of conversion.
                                    A/B+C*(D-E)

                                                                OR

                             Evaluate the following Postfix expression :
                             4,10,5,+,*,15,3,/,-

             4        (a)    Write a function RevText() to read a text file “ Input.txt “ and Print only     (2)
                             word starting with ‘I’ in reverse order .
                             Example: If value in text file is: INDIA IS MY COUNTRY
                             Output will be: AIDNI SI MY COUNTRY

                                                                OR

                      (a)    Write a function in C++ to count the number of lowercase alphabets present
                             in a text file “BOOK..txt".


                                                              7
   54   55   56   57   58   59   60   61   62   63   64