Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.
You're offline
Unit 9 MCQsSoftware Programming and Development
DECAP145 ·
60 questions. Pick an option to check it.
Question 1 of 60 · What is computer Program · Easy
What is a computer program?
Not quite. Try another option.
Answer: A set of instructions that tells a computer what to do
A computer program is a sequence of instructions written to perform a specific task on a computer.
Question 2 of 60 · What is computer Program · Easy
A program written by a programmer in a human-readable language is called the:
Not quite. Try another option.
Answer: Source code
Source code is the version of a program written in a programming language that humans can read and edit.
Question 3 of 60 · What is computer Program · Easy
Which of the following is an example of application software?
Not quite. Try another option.
Answer: A word processor
A word processor is application software, while the other options are hardware components.
Question 4 of 60 · What is computer Program · Easy
The language that a computer's processor can directly understand is called:
Not quite. Try another option.
Answer: Machine language
Machine language is made of binary (0s and 1s) and is the only language the CPU directly executes.
Question 5 of 60 · What is computer Program · Easy
A collection of programs and related data that runs on a computer is generally called:
Not quite. Try another option.
Answer: Software
Software refers to the programs and data that instruct the hardware, as opposed to the physical components.
Question 6 of 60 · Hardware/Software Interaction · Easy
Which type of software acts as a bridge between the hardware and application programs?
Not quite. Try another option.
Answer: Operating system
The operating system manages hardware resources and allows application software to run on them.
Question 7 of 60 · Hardware/Software Interaction · Easy
Which statement about hardware and software is correct?
Not quite. Try another option.
Answer: Software needs hardware to run
Software is a set of instructions that requires physical hardware to execute its operations.
Question 8 of 60 · Hardware/Software Interaction · Easy
A small program that lets the operating system communicate with a specific hardware device is called a:
Not quite. Try another option.
Answer: Device driver
A device driver translates operating system commands into instructions a hardware device understands.
Question 9 of 60 · Hardware/Software Interaction · Easy
When you press a key on the keyboard, which component processes the resulting instruction?
Not quite. Try another option.
Answer: The CPU
The CPU (Central Processing Unit) processes instructions, including input received from the keyboard.
Question 10 of 60 · Hardware/Software Interaction · Easy
Where must a program be loaded before the CPU can execute it?
Not quite. Try another option.
Answer: Main memory (RAM)
Programs are loaded into RAM so the CPU can quickly fetch and execute their instructions.
Question 11 of 60 · Planning a Computer Program · Easy
A diagram that uses symbols to show the steps of a program is called a:
Not quite. Try another option.
Answer: Flowchart
A flowchart uses standard symbols and arrows to represent the sequence of steps in a program.
Question 12 of 60 · Planning a Computer Program · Easy
Writing program logic in plain English-like statements before coding is known as:
Not quite. Try another option.
Answer: Pseudocode
Pseudocode expresses program logic in readable, informal terms without strict programming syntax.
Question 13 of 60 · Planning a Computer Program · Easy
In a standard flowchart, which shape usually represents a decision?
Not quite. Try another option.
Answer: Diamond
A diamond shape represents a decision point where the flow branches based on a condition.
Question 14 of 60 · Planning a Computer Program · Easy
What is usually the first step when planning a computer program?
Not quite. Try another option.
Answer: Understanding and defining the problem
You must clearly understand the problem before designing or coding a solution.
Question 15 of 60 · Planning a Computer Program · Easy
An algorithm can best be described as:
Not quite. Try another option.
Answer: A step-by-step procedure to solve a problem
An algorithm is a finite set of ordered steps used to solve a problem or complete a task.
Question 16 of 60 · Planning a Computer Program · Easy
In a flowchart, which symbol is generally used to represent a process or action step?
Not quite. Try another option.
Answer: Rectangle
A rectangle represents a processing step or action in a standard flowchart.
Question 17 of 60 · How programs Solve Problems · Easy
The process of finding and fixing errors in a program is called:
Not quite. Try another option.
Answer: Debugging
Debugging is the activity of locating and correcting errors, or bugs, in a program.
Question 18 of 60 · How programs Solve Problems · Easy
A general model of how a program solves a problem follows the order:
Not quite. Try another option.
Answer: Input, process, output
Programs typically take input, process it according to instructions, and then produce output.
Question 19 of 60 · How programs Solve Problems · Easy
An error in the rules or grammar of a programming language is called a:
Not quite. Try another option.
Answer: Syntax error
A syntax error occurs when code breaks the grammatical rules of the programming language.
Question 20 of 60 · How programs Solve Problems · Easy
To solve a large, complex problem with a program, it is best to:
Not quite. Try another option.
Answer: Break it into smaller subproblems
Dividing a big problem into smaller, manageable parts makes it easier to design and solve.
Question 21 of 60 · What is computer Program · Medium
A student writes a set of instructions in Python that reads two numbers and prints their sum. Before the CPU can execute these instructions, what must happen?
Not quite. Try another option.
Answer: The instructions must be translated into machine code
A program written in a high-level language is source code. The CPU only understands machine code, so a compiler or interpreter must translate it before execution.
Question 22 of 60 · What is computer Program · Medium
Which statement best distinguishes a program from an algorithm?
Not quite. Try another option.
Answer: An algorithm is a step-by-step method, while a program is that method written in a programming language
An algorithm is a logical, language-independent solution. A program is the concrete implementation of that algorithm in a specific programming language.
Question 23 of 60 · What is computer Program · Medium
A program is described as a sequence of instructions that is stored and then executed. This idea is central to which computer concept?
Not quite. Try another option.
Answer: The stored-program concept
The stored-program concept means instructions are held in memory alongside data and fetched for execution, which is the basis of modern computers.
Question 24 of 60 · What is computer Program · Medium
Which of the following is the clearest example of system software rather than an application program?
Not quite. Try another option.
Answer: An operating system that manages memory and devices
System software, such as an operating system, manages hardware and provides a platform. The other options are application programs that serve end-user tasks.
Question 25 of 60 · What is computer Program · Medium
A file with the .exe extension runs directly when double-clicked, while a .py file needs Python installed. What does this difference tell you?
Not quite. Try another option.
Answer: The .exe already contains machine code, while the .py needs an interpreter
An executable file holds machine code the CPU can run directly, while a .py script is source code that requires the Python interpreter to translate and run it.
Question 26 of 60 · Hardware/Software Interaction · Medium
When you press a key on the keyboard, which layer is most directly responsible for translating that hardware signal so applications can use it?
Not quite. Try another option.
Answer: The operating system through its device drivers
Device drivers, managed by the operating system, translate hardware signals into a form that software can understand, bridging hardware and applications.
Question 27 of 60 · Hardware/Software Interaction · Medium
An application wants to save a file to disk but cannot access the hardware directly. How does it accomplish this?
Not quite. Try another option.
Answer: It requests the service from the operating system
Applications ask the operating system to perform hardware operations through system calls. The OS then coordinates with drivers and hardware, keeping access safe and managed.
Question 28 of 60 · Hardware/Software Interaction · Medium
Which sequence correctly represents the layers of interaction from top to bottom?
Not quite. Try another option.
Answer: Application → Operating System → Hardware
The user interacts with applications, which call the operating system, which in turn controls the hardware. This layered model keeps each level manageable.
Question 29 of 60 · Hardware/Software Interaction · Medium
A new printer is connected but does not work until specific software is installed. What is this software called and what does it do?
Not quite. Try another option.
Answer: A device driver that lets the OS communicate with the printer
A device driver provides the OS with instructions on how to control a specific hardware device, enabling proper communication between software and the printer.
Question 30 of 60 · Hardware/Software Interaction · Medium
During program execution, where are the active instructions and data primarily held for the CPU to access quickly?
Not quite. Try another option.
Answer: In RAM (main memory)
When a program runs, its instructions and data are loaded into RAM so the CPU can fetch and execute them quickly, since disk access is much slower.
Question 31 of 60 · Hardware/Software Interaction · Medium
Why is software necessary for hardware to be useful?
Not quite. Try another option.
Answer: Hardware performs no meaningful task without instructions from software
Hardware is the physical machinery, but it needs software instructions to know what to do. Together they form a working computer system.
Question 32 of 60 · Planning a Computer Program · Medium
A developer draws boxes and arrows to map the flow of decisions and steps before coding. Which planning tool is being used?
Not quite. Try another option.
Answer: A flowchart
A flowchart uses standardized symbols and arrows to represent the logic and flow of a program, helping plan the solution before writing code.
Question 33 of 60 · Planning a Computer Program · Medium
In a flowchart, which symbol is used to represent a decision that has multiple possible outcomes?
Not quite. Try another option.
Answer: A diamond
The diamond symbol represents a decision point where a condition is tested, leading to different paths such as yes/no or true/false.
Question 34 of 60 · Planning a Computer Program · Medium
Why do programmers often write pseudocode before writing actual code?
Not quite. Try another option.
Answer: It expresses program logic in plain language without worrying about syntax
Pseudocode lets programmers focus on the logic of the solution using readable statements, free from the strict syntax rules of any language.
Question 35 of 60 · Planning a Computer Program · Medium
What is the correct general order of steps in the program development process?
Not quite. Try another option.
Answer: Define the problem → design the solution → code → test
Good program development starts by understanding the problem, designing a solution, implementing it as code, and finally testing to verify correctness.
Question 36 of 60 · Planning a Computer Program · Medium
A team breaks a large program into smaller, manageable pieces that each handle one task. What planning approach is this?
Not quite. Try another option.
Answer: Modular design (decomposition)
Decomposition, or modular design, splits a big problem into smaller modules that are easier to develop, test, and maintain independently.
Question 37 of 60 · Planning a Computer Program · Medium
In a flowchart, what is the purpose of the oval (terminator) symbol?
Not quite. Try another option.
Answer: To mark the start or end of the process
The oval terminator symbol shows where a flowchart begins and where it ends, defining the boundaries of the process.
Question 38 of 60 · How programs Solve Problems · Medium
A program repeatedly executes a block of code until a condition becomes false. Which control structure does this describe?
Not quite. Try another option.
Answer: A loop (iteration)
A loop repeats a set of instructions while a condition holds, allowing programs to handle repetitive tasks efficiently.
Question 39 of 60 · How programs Solve Problems · Medium
A program must choose between two different actions based on whether a user's age is . Which control structure is required?
Not quite. Try another option.
Answer: Selection (if-else)
Selection structures like if-else let a program choose different paths based on whether a condition is true or false.
Question 40 of 60 · How programs Solve Problems · Medium
Programs solve problems by processing input into output. In the model , what does the process stage represent?
Not quite. Try another option.
Answer: The logic and calculations applied to the data
The process stage is where the program applies logic, calculations, and transformations to convert input data into useful output.
Question 41 of 60 · What is computer Program · Hard
A program is described as a set of instructions that is stored and then executed. In the stored-program (von Neumann) model, which characteristic most directly distinguishes a program from fixed-function hardware logic?
Not quite. Try another option.
Answer: Instructions reside in the same addressable memory as data and can be modified at runtime
The stored-program concept treats instructions like data in the same memory space, so programs can be loaded, changed, and even generated at runtime. Fixed-function hardware encodes logic physically and cannot be reprogrammed this way.
Question 42 of 60 · What is computer Program · Hard
Consider source code, object code, and an executable. Which statement correctly orders their dependence and portability characteristics?
Not quite. Try another option.
Answer: Source code is most portable; object code is machine-specific but unlinked; the executable is machine-specific and runnable
Source code is high-level and portable across platforms via recompilation. Object code is machine-level output of compilation but not yet linked. The linked executable is machine-specific and directly runnable.
Question 43 of 60 · What is computer Program · Hard
A programmer claims that an interpreted program and a compiled program are "the same program". From a purely definitional standpoint, what is the most accurate response?
Not quite. Try another option.
Answer: They are the same logical program; only the translation-and-execution strategy differs
A program is defined by its logic and instructions, independent of how it is translated. Interpretation and compilation are different execution strategies, not different programs. Execution speed usually differs, so that claim is false.
Question 44 of 60 · What is computer Program · Hard
Why is a program written entirely in machine code considered a valid program but rarely written directly by humans today?
Not quite. Try another option.
Answer: It is directly executable but error-prone and unmaintainable due to raw binary encoding
Machine code is the CPU's native, directly executable form, so it is a valid program. Humans avoid it because writing binary opcodes by hand is extremely error-prone and hard to maintain, not because it lacks capability or speed.
Question 45 of 60 · Hardware/Software Interaction · Hard
When an application requests to write a file to disk, the request typically passes through multiple layers. Which sequence best reflects the interaction from top to bottom?
Not quite. Try another option.
Answer: Application → OS system call → device driver → hardware controller
The application issues a system call to the OS, which routes it to the appropriate device driver, which in turn communicates with the physical hardware controller. This layering isolates applications from hardware specifics.
Question 46 of 60 · Hardware/Software Interaction · Hard
A CPU can only execute machine instructions. Given a high-level program, which combination of components is minimally required to make it run on the hardware?
Not quite. Try another option.
Answer: A translator (compiler/interpreter) plus an OS to load and manage execution
High-level code must be translated to machine instructions the CPU understands, and an operating system is normally needed to load the program and manage its access to hardware and memory. The CPU and OS alone cannot run untranslated high-level code.
Question 47 of 60 · Hardware/Software Interaction · Hard
During an interrupt-driven I/O operation, why is polling generally considered less efficient than interrupts for hardware/software interaction?
Not quite. Try another option.
Answer: Polling wastes CPU cycles repeatedly checking device status, while interrupts notify only when ready
Polling loops keep the CPU busy checking whether a device is ready, wasting cycles. Interrupts let the device signal the CPU only when attention is needed, freeing the CPU for other work in the meantime.
Question 48 of 60 · Hardware/Software Interaction · Hard
System software and application software both interact with hardware. Which statement most accurately contrasts their access?
Not quite. Try another option.
Answer: System software often runs in privileged mode with direct hardware access; applications run in user mode and request services
The OS (system software) runs in a privileged/kernel mode with direct hardware control. Applications run in a restricted user mode and must request hardware services through the OS, which protects the system from misbehaving programs.
Question 49 of 60 · Hardware/Software Interaction · Hard
A program compiled for one CPU architecture fails to run on another even though both use the same operating system family. What is the primary reason?
Not quite. Try another option.
Answer: The machine instruction set differs, so the compiled binary is not understood by the other CPU
A compiled binary targets a specific instruction set architecture (ISA). A different CPU with a different ISA cannot decode those instructions. Recompiling the same source for the new architecture is the usual solution.
Question 50 of 60 · Planning a Computer Program · Hard
In the program development cycle, why must problem analysis and requirement specification precede algorithm design?
Not quite. Try another option.
Answer: A correct algorithm cannot be designed without a clear, unambiguous definition of the problem and expected outputs
You cannot design a solution to a problem you have not clearly defined. Establishing inputs, outputs, and constraints first ensures the algorithm actually solves the intended problem rather than a misunderstood one.
Question 51 of 60 · Planning a Computer Program · Hard
A flowchart and pseudocode both express algorithm logic before coding. Which statement best captures a meaningful trade-off between them?
Not quite. Try another option.
Answer: Flowcharts visualize control flow well but scale poorly; pseudocode scales to complex logic but hides visual flow
Flowcharts make branching and flow visually clear but become cluttered for large programs. Pseudocode handles complex logic compactly using structured text but does not visually depict flow. Neither is executable, and both are language-independent.
Question 52 of 60 · Planning a Computer Program · Hard
During planning, a developer identifies that a required calculation depends on a value not available until runtime. What planning technique best addresses this before coding?
Not quite. Try another option.
Answer: Define it as an input variable and specify how it will be obtained and validated
Good planning treats runtime-dependent values as inputs, specifying their source and validation. Hard-coding assumptions or deferring the design leads to fragile programs. Recognizing inputs early is central to the analysis phase.
Question 53 of 60 · Planning a Computer Program · Hard
Why does modular (top-down) program design improve maintainability compared to a single monolithic block of code?
Not quite. Try another option.
Answer: Each module isolates a subproblem, so changes and testing can be localized without affecting others
Top-down decomposition splits a problem into independent modules. This localizes changes, simplifies testing, and improves reuse. It does not remove the need for algorithms or testing, and it does not guarantee speed.
Question 54 of 60 · Planning a Computer Program · Hard
A team writes detailed pseudocode but skips documenting assumptions and edge cases. What is the most likely downstream consequence?
Not quite. Try another option.
Answer: Coders make inconsistent assumptions, producing defects that surface only for boundary inputs
Undocumented assumptions and edge cases lead different implementers to fill gaps differently, causing bugs that appear at boundaries (empty input, maximums, zero, etc.). Pseudocode alone does not compile and does not eliminate testing.
Question 55 of 60 · How programs Solve Problems · Hard
An algorithm to find the maximum in a list initializes max to the first element rather than to . Why is this the more robust choice?
Not quite. Try another option.
Answer: Initializing to the first element handles negative values and empty-guarded lists correctly
If all values are negative, starting max at wrongly returns . Starting from the first actual element (after confirming the list is non-empty) guarantees a valid comparison base regardless of value ranges.
Question 56 of 60 · How programs Solve Problems · Hard
Two algorithms solve the same problem: Algorithm A runs in and Algorithm B in . For a small input of , A completes faster. What is the correct interpretation?
Not quite. Try another option.
Answer: Asymptotic complexity describes scaling for large ; for small constant factors can make A faster
Big-O describes growth as becomes large and ignores constant factors. For small inputs, a lower-complexity algorithm may lose to a higher-complexity one with smaller constants. B wins as grows large.
Question 57 of 60 · How programs Solve Problems · Hard
A problem-solving process follows: understand the problem, devise a plan, carry out the plan, then review. Which activity best represents the "review" step in program development?
Not quite. Try another option.
Answer: Testing outputs against expected results and refining the algorithm for missed cases
The review step validates the solution by comparing actual results to expected ones and improving it where it fails. Defining inputs is part of understanding; choosing a language and writing code belong to earlier steps.
Question 58 of 60 · How programs Solve Problems · Hard
A recursive solution and an iterative solution both compute the same result. On a system with a small call stack, the recursive version crashes for large inputs while the iterative one succeeds. What is the root cause?
Not quite. Try another option.
Answer: Deep recursion consumes stack frames until the stack overflows, unlike the iterative loop
Each recursive call adds a stack frame. For large inputs without tail-call optimization, the stack can overflow. An iterative loop reuses a fixed set of variables, avoiding unbounded stack growth.
Question 59 of 60 · How programs Solve Problems · Hard
An algorithm uses a loop with condition while (x != 0) and decrements x by 2 each iteration. Starting from an odd positive x, what problem arises and why?
Not quite. Try another option.
Answer: An infinite loop occurs because x never equals exactly when starting odd and stepping by
Subtracting from an odd number keeps it odd, so x skips over (e.g., ) and the exact equality check with never holds. Using x > 0 or checking parity would fix it.
Question 60 of 60 · How programs Solve Problems · Hard
When decomposing a complex problem into subproblems, why is it important that subproblem solutions can be combined without unintended interaction?
Not quite. Try another option.
Answer: Independent, composable subproblems prevent one module's side effects from corrupting another's result
Effective decomposition relies on subproblems being independent so their results combine cleanly. Uncontrolled side effects or shared mutable state can make one module corrupt another's output, breaking the overall solution.
That's unit 9
Answer a few questions and your score shows up here.
Nearly through. Did unit 9 of DECAP145 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 9 of DECAP145 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill;
the rest comes out of a student's own pocket: the domain, the storage, and keeping
the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.