Bcse102 Exam Multi-choice Part 2

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Rowanwd
R
Rowanwd
Community Contributor
Quizzes Created: 4 | Total Attempts: 277
Questions: 15 | Attempts: 77

SettingsSettingsSettings
Bcse102 Exam Multi-choice Part 2 - Quiz

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

    Correct Answer
    A. A higher level of modular granularity than a Class
    Explanation
    A package is a higher level of modular granularity than a class. In object-oriented programming, a package is a way to organize and group related classes and interfaces. It provides a higher level of abstraction and encapsulation compared to a class. A package can contain multiple classes and can be used to organize and manage the dependencies between classes. It helps in maintaining code reusability, readability, and manageability by grouping related components together. Therefore, a package is considered to have a higher level of modular granularity than a class.

    Rate this question:

  • 2. 

    Containment is the __________ relationship.  

    • A.

      Inheritance

    • B.

      has a

    • C.

      Is a

    • D.

      multiple inheritance

    Correct Answer
    B. has a
    Explanation
    The correct answer is "has a". In object-oriented programming, the "has a" relationship refers to a class having an instance of another class as one of its member variables. It represents a composition or aggregation relationship where the containing class has a reference to the contained class. This allows the containing class to access and use the functionality and properties of the contained class.

    Rate this question:

  • 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

    Correct Answer
    D. The enforcer that prevents you from looking at the details even if you want to
    Explanation
    Encapsulation is the enforcer that prevents you from looking at the details even if you want to. This means that encapsulation hides the internal implementation details of an object, allowing you to interact with it through a well-defined interface. It promotes information hiding and abstraction, protecting the internal state and implementation of an object from being accessed or modified directly. This enhances security, maintainability, and flexibility in software development.

    Rate this question:

  • 4. 

    How long should a routine be?  

    • A.

      > 500

    • B.

      A screen length

    • C.

      Less than 200 lines

    • D.

      5 pages

    Correct Answer
    C. Less than 200 lines
    Explanation
    The correct answer is "Less than 200 lines" because routines should be concise and focused. Having a routine that exceeds 200 lines can make it difficult to understand and maintain. By keeping routines shorter, it becomes easier to read, debug, and modify the code. It also promotes better code organization and improves code reusability.

    Rate this question:

  • 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

    Correct Answer
    D. To improve readability
    Explanation
    A good small routine can be helpful to improve readability. By breaking down a complex task into smaller, more manageable steps, it becomes easier for others (and even ourselves) to understand and follow the logic of the code. This improves the overall clarity and maintainability of the codebase. Additionally, smaller routines can be reused in different parts of the program, promoting code reusability and reducing redundancy. However, the given options do not mention code reusability or reducing the overall size of code as reasons for the helpfulness of a good small routine.

    Rate this question:

  • 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

    Correct Answer
    D. it improves readability
    Explanation
    Having small routines improves readability because it allows for easier understanding and comprehension of the code. When routines are small, they are easier to follow and analyze, making it simpler to identify and fix any issues or bugs. Additionally, small routines promote modularity and reusability, as they can be easily combined and utilized in different parts of the codebase. This ultimately leads to more maintainable and scalable code, enhancing the overall readability and understandability of the program.

    Rate this question:

  • 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

    Correct Answer
    C. documenting assumptions made in the code
    Explanation
    Assertions are best used for documenting assumptions made in the code. Assertions help in clarifying the intentions and assumptions of the code, making it easier for other developers to understand and maintain the code. By documenting these assumptions, it becomes clear what conditions are expected to be true at certain points in the code. This can help in debugging and identifying potential issues. Assertions also serve as a form of self-documentation, making the code more readable and maintainable.

    Rate this question:

  • 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

    Correct Answer
    B. Introduce debugging aids early
    Explanation
    Introducing debugging aids early in the programming process allows for the identification and resolution of any potential issues or errors before the production code is running. This proactive approach helps to minimize the occurrence of exceptional cases during development and ensures that they can be easily identified and resolved. By addressing these cases early on, the code can be optimized to avoid them during production, resulting in a more efficient and reliable program.

    Rate this question:

  • 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

    Correct Answer
    D. Throw (raise) exceptions
    Explanation
    When handling errors that are expected to occur, it is recommended to throw (raise) exceptions. By throwing exceptions, we can provide a clear indication that an error has occurred and allow the program to handle the error appropriately. This approach helps in maintaining the code's integrity and makes it easier to debug and fix issues. Ignoring errors may lead to unexpected behavior and make it difficult to identify and resolve problems. Using assertions can be useful for checking assumptions during development, but they are not suitable for handling expected errors in production code. Substituting valid values may not accurately represent the error and can lead to incorrect results.

    Rate this question:

  • 10. 

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

    • A.

      Hacking

    • B.

      Test-first development

    • C.

      Factoring

    • D.

      UML

    Correct Answer
    B. Test-first development
    Explanation
    Test-first development is a recommended alternative or supplement to the Pseudocode Programming Process. Test-first development is an approach where developers write tests for a piece of functionality before writing the actual code. This ensures that the code meets the desired requirements and helps in identifying any potential issues early in the development process. It promotes better code quality, improved design, and faster development cycles.

    Rate this question:

  • 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

    Correct Answer
    A. After checking the design (for example with a desk checks)
    Explanation
    The coding should be done after checking the design, for example with a desk check. This ensures that any errors or issues in the design are identified and resolved before the code is written. By reviewing the design first, it allows for a more efficient and effective coding process, reducing the likelihood of errors and improving the overall quality of the code.

    Rate this question:

  • 12. 

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

    • A.

      Complicated

    • B.

      Pass-through

    • C.

      Accessor

    • D.

      All

    Correct Answer
    A. Complicated
    Explanation
    The creation of complicated routines benefits most from a systematic approach like the Pseudocode Programming Process. This is because complicated routines involve complex logic and require careful planning and organization. Pseudocode allows programmers to break down the complicated routine into smaller, more manageable steps, making it easier to understand and implement. By following a systematic approach like the Pseudocode Programming Process, programmers can ensure that the complicated routine is developed correctly and efficiently.

    Rate this question:

  • 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

    Correct Answer
    B. initialize each variable close to where it is first used
    Explanation
    In programming languages like Jade and VB, where variables cannot be initialized as they are declared, a valid guideline to avoid initialization problems is to initialize each variable close to where it is first used. This ensures that the variable is initialized before it is accessed or manipulated, reducing the chances of encountering errors or unexpected behavior. By initializing variables close to their first usage, it promotes code readability and helps in identifying the purpose and scope of each variable more easily.

    Rate this question:

  • 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

    Correct Answer
    D. intellectual manageability as it simplifies the reading of programs
    Explanation
    The correct answer is "intellectual manageability as it simplifies the reading of programs". This choice suggests that prioritizing intellectual manageability, or making the code easier to understand and read, is more important than convenience in speeding up the writing of programs. By prioritizing intellectual manageability, it becomes easier for different people to write code in a consistent and understandable way, leading to better collaboration and maintainability of the codebase.

    Rate this question:

  • 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

    Correct Answer
    C. New code might be added, inadvertently altering the variable
    Explanation
    The code between references to a variable is a window of vulnerability because new code might be added, inadvertently altering the variable. This means that if new code is added within the section of code where the variable is referenced, it could unintentionally modify the value of the variable. This can lead to unexpected behavior and potential bugs in the program. It is important to be cautious when making changes within this window of vulnerability to ensure that the variable is not inadvertently altered.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jun 13, 2015
    Quiz Created by
    Rowanwd
Back to Top Back to top
Advertisement