Page 77 - C++
P. 77

1 Mark for writing correct formula (for column major)
                             OR substituting formula with correct values)
                             (1 Mark for correct step calculations)
                             (1 Mark for final correct address)

                                                                OR

                             1 Mark for writing correct formula (for Row major)
                             OR substituting formula with correct values)
                             (1 Mark for correct step calculations)
                             (1 Mark for final correct address)


                      (d)    Write the definition of a member function Ins_Player() for a class          (4)
                             CQUEUE in C++, to add a Player in a statically allocated circular queue of
                             PLAYERs considering the following code
                             is already written as a part of the program:
                             struct Player
                             {
                                    long Pid;
                                   char Pname[20];
                             };
                             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

                             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;
                             };

                                                             13
   72   73   74   75   76   77   78   79   80   81   82