Skip to content

Punjab (PTB) · Half book test · Free

2nd Year Computer First half Book Paper

50 marks · 1 hour 30 minutes · 35 questions. Covers: 5 chapters (CHAP 1: COMPUTER NETWORKS to CHAP 5: CODE TESTING AND DEBUGGING).

Your school name

2nd Year Computer First half Book Paper

2nd Year · Computer · Punjab (PTB)

Name: ____________Roll No: ________Class/Section: ________Date: ________Total marks: 50Time: 1 hour 30 minutes

Q1. Multiple choice questions (Attempt all · 15 × 1 = 15)

  1. Where does sqlite3 store its database data on the system?

    1. In local RAM cache

    2. In a single file on the system

    3. On a remote server automatically

    4. In the Python installation folder

  2. The statement 2 + 3 = 5 evaluates to:

    1. True

    2. False

    3. Undefined

    4. Unknown

  3. What are breakpoints and watches used for in software development?

    1. To compile source code into machine code

    2. To analyze program behavior and examine data at specific points

    3. To format Python source code automatically

    4. To speed up the execution of loops

  4. What is a key benefit of wireless network connections in a home environment?

    1. They are always faster than wired connections

    2. They completely eliminate the need for a modem

    3. Devices can move freely within the network range

    4. They do not require configuration or passwords

  5. OOP allows code to be divided into modules, which promotes:

    1. Modularity

    2. Redundancy

    3. Fragmentation

    4. Linear execution

  6. When does a function linked to an event run?

    1. Continuously while the application is open

    2. Before the GUI window loads

    3. Only when the event happens

    4. When the program is compiled

  7. Words used to connect propositions are called:

    1. Logical connectives

    2. Basic units

    3. Capital letters

    4. Commands

  8. What are breakpoints defined as in IDEs like PyCharm or VS Code?

    1. Keywords that stop program compilation

    2. Variables that store error logs

    3. Markers that pause program execution at a chosen line of code

    4. Functions that return calculated values

  9. Which device connects different networks together and links a local network to the Internet?

    1. Router

    2. Monitor

    3. Ethernet Port

    4. Power supply

  10. An object is defined as a(n):

    1. Abstract definition with no memory allocation

    2. Instance of a class that holds actual values for its attributes

    3. Standalone function without data

    4. External library module

  11. GUIs improve usability primarily by providing:

    1. Complex command lines

    2. Visual feedback and reducing the need to remember complex commands

    3. Faster compilation times

    4. Automatic database integration

  12. Quantifiers in library system modelling allow describing:

    1. Only mathematical numbers

    2. Only hardware configurations

    3. Both general situations and specific cases

    4. Truth tables with two rows

  13. Which step-by-step debugging action allows you to go inside a function to see how it is working?

    1. Step Over

    2. Step Into

    3. Continue

    4. Pause

  14. Which type of network provides high data transfer speed?

    1. WAN

    2. Public WAN

    3. LAN

    4. Satellite network

  15. The main idea behind encapsulation in OOP is:

    1. To hide data inside a class and prevent unauthorised access.

    2. To create a flexible and adaptable programme.

    3. To reuse code from other classes.

    4. To allow multiple inheritance in classes.

Q2. Short questions (Attempt any 10 of 15 · 10 × 2 = 20)

  1. Why do quantifiers make predicate logic more powerful than propositional logic?

  2. What is the difference between how a router and a switch direct data?

  3. What are two primary benefits of using inheritance?

  4. What are two primary benefits of performing unit testing?

  5. What happens if connection.commit() is omitted after a delete operation?

  6. How do computers make use of deduction?

  7. What is a network protocol?

  8. What is the difference between compile-time and runtime polymorphism?

  9. What are three optimization techniques used to fix performance bottlenecks?

  10. How user input is processed using widgets and connected functions?

  11. When is a proposition considered unsatisfiable?

  12. Briefly describe the Round Robin method of load balancing.

  13. How many types of Inheritance are there?

  14. What is a performance bottleneck in programming?

  15. What is meant by an attribute?

Q3. Long questions (Attempt any 3 of 5 · 3 × 5 = 15)

  1. Write a program to create Simple Login Form in tkinter.

  2. Discuss in detail the importance of testing and debugging techniques in software development, highlighting how they improve performance, user confidence, and future maintenance.

  3. Explain the types of computer networks. Describe LAN, WAN, and the Internet.

  4. What is propositional satisfiability? Explain satisfiable and unsatisfiable propositions with examples.

  5. Write a python code to demonstrate the concept of Runtime polymorphism (Overriding) by creating classes Animal, Dog and Cat.