Page 304 - C++
P. 304

CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
                                      (Sub Code: 083 Paper Code 91 Outside Delhi)

                             void REGISTER();void DISPLAY();
                           };

                           void main()
                           {
                             fstream File;
                             File.open("CLIENTS.DAT",ios::binary|ios::in);
                             CLIENTS C;
                             File.seekg(6*sizeof(C));
                             File.read((char*)&C, sizeof(C));
                             cout<<"Client Number:"<<File.tellg()/sizeof(C) + 1;
                             File.seekg(0,ios::end);
                             cout<<" of "<<File.tellg()/sizeof(C)<<endl;
                             File.close();
                           }
                   Ans    Client Number 8 of 200


                           (½ Mark for displaying correct value of File.tellg()/sizeof(C) + 1)
                           (½ Mark for displaying correct value of File.tellg()/sizeof(C))

             SECTION B - [Only for candidates, who opted for Python]
             1     (a)    Which of the following can be used as valid variable identifier(s) in Python?        2
                          (i)​ 4thSum
                          (ii)​ ​Total
                          (iii)​ ​Number#
                          (iv)​ ​_Data

                   Ans    ii) Total                    iv) _Data

                          (1 mark for each correct option)
                          NOTE:
                          Deduct ½ Mark for each wrong name written
                   (b)    Name the Python Library modules which need to be imported to invoke the                                      1
                          following functions
                          (i) ​floor()
                          (ii) ​randint()

                   Ans    math
                          random

                          (½ Mark for writing each correct Library modules)
                          NOTE:
                          Ignore any other Library modules, if mentioned.
                   (c)    Rewrite the following code in python after removing all syntax error(s). Underline   2
                          each correction done in the code.
                          STRING=""WELCOME
                          NOTE""
                          for S in range[0,8]:
                            print STRING(S)
                          print S+STRING


                                                     Page #14 of 28
   299   300   301   302   303   304   305   306   307   308   309