Bcse102 Exam Multi-choice Part 2

15 Questions | Total Attempts: 58

SettingsSettingsSettings
Please wait...
Bcse102 Exam Multi-choice Part 2

Questions 16-30 and this time I will put them more out of order ;)


Questions and Answers
  • 1. 
    A Package is __________.
    • A. 

      A higher level of modular granularity than a Class

    • B. 

      The same level of modular granularity as a Statement

    • C. 

      The same level of modular granularity as a Class

    • D. 

      A lower level of modular granularity than a Class

  • 2. 
    Containment is the __________ relationship.  
    • A. 

      Inheritance

    • B. 

      has a

    • C. 

      Is a

    • D. 

      multiple inheritance

  • 3. 
    Encapsulation is __________.  
    • A. 

      providing models that allow you to focus on implementation details

    • B. 

      Providing models that allow you to ignore implementation details

    • C. 

      The enabler that allows you to look at the details if you want to

    • D. 

      The enforcer that prevents you from looking at the details even if you want to

  • 4. 
    How long should a routine be?  
    • A. 

      > 500

    • B. 

      A screen length

    • C. 

      Less than 200 lines

    • D. 

      5 pages

  • 5. 
    One of the strongest mental blocks to creating effective routines is a reluctance to create a simple routine for a simple purpose. Which of the following is the best reason why a good small routine can be helpful?  
    • A. 

      Reuse

    • B. 

      To reduce the overall size of code

    • C. 

      because it may turn into a larger operation latter

    • D. 

      To improve readability

  • 6. 
    The MAIN advantage of having small routines is __________?  
    • A. 

      it reduces complexity

    • B. 

      It improves performance

    • C. 

      It avoids duplicated code

    • D. 

      it improves readability

  • 7. 
    The best use of Assertions is __________.  
    • A. 

      Documenting and verifying preconditions and post conditions

    • B. 

      Checking the values of all data from external sources

    • C. 

      documenting assumptions made in the code

    • D. 

      Checking the values of all routine input parameters

  • 8. 
    How can you program 'offensively'?  
    • A. 

      Exceptional cases should be avoided during development

    • B. 

      Introduce debugging aids early

    • C. 

      Exceptional cases should be handled in such a way that makes them obvious during development and recoverable when production code is running

    • D. 

      Exceptional cases should be handled in such a way that makes them rare during development and avoided when production code is running

  • 9. 
    How should you handle errors that you expect to occur?  
    • A. 

      Ignore them

    • B. 

      Use assertions

    • C. 

      Substitute valid values

    • D. 

      Throw (raise) exceptions

  • 10. 
    A recommended alternative or supplement to the Pseudocode Programming Process is __________.  
    • A. 

      Hacking

    • B. 

      Test-first development

    • C. 

      Factoring

    • D. 

      UML

  • 11. 
    If following the Pseudocode Programming Process, coding should be done __________.  
    • A. 

      After checking the design (for example with a desk checks)

    • B. 

      Before checking the design (for example with a desk checks)

    • C. 

      After you have reviewed the code

    • D. 

      As you design the routine

  • 12. 
    Creation of __________ routines benefits most from a systematic approach like the Pseudocode Programming Process.
    • A. 

      Complicated

    • B. 

      Pass-through

    • C. 

      Accessor

    • D. 

      All

  • 13. 
    A valid guideline which avoids initialisation problems (in programing languages Jade and VB languages which do not allow initialising variables as they are declared) is to __________.  
    • A. 

      Initialize each variable before it is declared

    • B. 

      initialize each variable close to where it is first used

    • C. 

      Initialize each variable at the beginning of the method

    • D. 

      Not initialize at all

  • 14. 
    In choosing between the convenience and intellectual manageability programming philosophies the choice should be __________.  
    • A. 

      Different people writing code in different ways; it really does not matter

    • B. 

      Convenience as it speeds the writing of programs

    • C. 

      intellectual manageability as it speeds the writing of programs

    • D. 

      intellectual manageability as it simplifies the reading of programs

  • 15. 
    The code between references to a variable is a window of vulnerability because __________.  
    • A. 

      the reference between variables are easily broken

    • B. 

      Variable might end up contain wrong value as they are always changing

    • C. 

      New code might be added, inadvertently altering the variable

    • D. 

      Variables are difficult to change

Back to Top Back to top