B.A set of instructions written to perform a specific task
C.An electronic circuit inside the CPU
D.A physical component of the computer
Correct Answer: A set of instructions written to perform a specific task
Explanation:
A program is a collection of instructions that a computer follows to accomplish a specific task.
Incorrect! Try again.
2The process of writing a set of instructions for a computer is called:
introduction to programming
Easy
A.Debugging
B.Programming
C.Compiling
D.Formatting
Correct Answer: Programming
Explanation:
Programming is the activity of writing instructions (code) that direct a computer to perform tasks.
Incorrect! Try again.
3A person who writes computer programs is called a:
program concept
Easy
A.Programmer
B.Analyst
C.Operator
D.Designer
Correct Answer: Programmer
Explanation:
A programmer is the individual who designs, writes, and tests computer programs.
Incorrect! Try again.
4Which of the following best describes source code?
program concept
Easy
A.The hardware that runs the program
B.The electricity supplied to the machine
C.The human-readable instructions written by a programmer in a programming language
D.The final output shown to the user
Correct Answer: The human-readable instructions written by a programmer in a programming language
Explanation:
Source code is the set of human-readable statements written in a programming language before translation into machine code.
Incorrect! Try again.
5Which of the following is a desirable characteristic of a good program?
characteristics of programming
Easy
A.Complexity
B.Ambiguity
C.Reliability
D.Slowness
Correct Answer: Reliability
Explanation:
A good program should be reliable, meaning it produces correct results consistently.
Incorrect! Try again.
6A program that is easy to read, understand, and modify is said to have good:
characteristics of programming
Easy
A.Obscurity
B.Redundancy
C.Volatility
D.Maintainability
Correct Answer: Maintainability
Explanation:
Maintainability refers to how easily a program can be understood, corrected, and updated over time.
Incorrect! Try again.
7The ability of a program to run on different types of machines with little or no change is called:
characteristics of programming
Easy
A.Security
B.Accuracy
C.Portability
D.Efficiency
Correct Answer: Portability
Explanation:
Portability is the characteristic that allows a program to be moved and run across different platforms.
Incorrect! Try again.
8Which stage usually comes first in program development?
stages in program development
Easy
A.Problem definition and analysis
B.Documentation
C.Coding the program
D.Testing the program
Correct Answer: Problem definition and analysis
Explanation:
Understanding and defining the problem is the first step before designing or coding a solution.
Incorrect! Try again.
9The process of finding and correcting errors in a program is known as:
stages in program development
Easy
A.Executing
B.Compiling
C.Linking
D.Debugging
Correct Answer: Debugging
Explanation:
Debugging is the stage where errors (bugs) in the program are located and fixed.
Incorrect! Try again.
10What is an algorithm?
algorithms
Easy
A.A software error
B.A step-by-step procedure to solve a problem
C.A type of computer hardware
D.A programming language
Correct Answer: A step-by-step procedure to solve a problem
Explanation:
An algorithm is a finite sequence of well-defined steps used to solve a particular problem.
Incorrect! Try again.
11Which property must every algorithm have?
algorithms
Easy
A.It must use graphics
B.It must run forever without stopping
C.It must terminate after a finite number of steps
D.It must be written only in C language
Correct Answer: It must terminate after a finite number of steps
Explanation:
An algorithm must be finite, meaning it ends after a limited number of steps.
Incorrect! Try again.
12Each step of an algorithm should be:
algorithms
Easy
A.Written in binary only
B.Optional to follow
C.Clear and unambiguous
D.Confusing and vague
Correct Answer: Clear and unambiguous
Explanation:
Every step in an algorithm must be precise and unambiguous so it can be followed without confusion.
Incorrect! Try again.
13Pseudocode is best described as:
notations
Easy
A.A special hardware notation
B.A compiled binary file
C.The actual machine code executed by the CPU
D.An informal, language-like way of describing an algorithm
Correct Answer: An informal, language-like way of describing an algorithm
Explanation:
Pseudocode expresses the logic of an algorithm in plain, structured language without strict programming syntax.
Incorrect! Try again.
14Which notation uses plain English-like statements rather than a specific programming language syntax?
notations
Easy
A.Binary code
B.Pseudocode
C.Machine code
D.Assembly code
Correct Answer: Pseudocode
Explanation:
Pseudocode describes algorithm logic using readable statements independent of any programming language.
Incorrect! Try again.
15A flowchart is a:
flowchart
Easy
A.Graphical representation of an algorithm
B.Programming language
C.Type of computer virus
D.Storage device
Correct Answer: Graphical representation of an algorithm
Explanation:
A flowchart uses symbols and arrows to visually represent the steps and flow of an algorithm.
Incorrect! Try again.
16In a flowchart, which symbol is used to represent a decision?
flowchart
Easy
A.Parallelogram
B.Rectangle
C.Diamond
D.Oval
Correct Answer: Diamond
Explanation:
The diamond symbol represents a decision point where the flow branches based on a condition.
Incorrect! Try again.
17Which flowchart symbol represents the start or end of a process?
flowchart
Easy
A.Rectangle
B.Oval (terminal)
C.Diamond
D.Arrow
Correct Answer: Oval (terminal)
Explanation:
The oval or rounded terminal symbol marks the beginning and the end of a flowchart.
Incorrect! Try again.
18Which of the following is a programming methodology?
types of programming methodologies
Easy
A.Random programming
B.Invisible programming
C.Circular programming
D.Structured programming
Correct Answer: Structured programming
Explanation:
Structured programming is a well-known methodology that organizes code using clear control structures and avoids unstructured jumps.
Incorrect! Try again.
19In the top-down approach, a large problem is:
top down and bottom up program development cycle with case study
Easy
A.Combined into one huge module
B.Broken down into smaller sub-problems
C.Solved only in machine code
D.Ignored until the end
Correct Answer: Broken down into smaller sub-problems
Explanation:
Top-down design starts with the main problem and divides it into smaller, manageable modules.
Incorrect! Try again.
20The bottom-up approach to program development begins by:
top down and bottom up program development cycle with case study
Easy
A.Deleting all sub-modules
B.Writing documentation before analysis
C.Building smaller components first and then combining them into a complete system
D.Designing the main module last
Correct Answer: Building smaller components first and then combining them into a complete system
Explanation:
Bottom-up design starts by creating basic lower-level modules and then integrating them to form the larger system.
Incorrect! Try again.
21A team is converting a real-world payroll process into a computer program. Which sequence correctly represents the transformation from problem to executable software?
introduction to programming
Medium
A.Algorithm → Problem → Machine code → Program
B.Program → Algorithm → Problem → Machine code
C.Problem → Algorithm → Program → Machine code
D.Machine code → Program → Algorithm → Problem
Correct Answer: Problem → Algorithm → Program → Machine code
Explanation:
A problem is first analyzed and expressed as an algorithm, then coded into a program, which is finally translated into machine code the computer can execute.
Incorrect! Try again.
22A program repeatedly produces different results for the same input values even though the code is unchanged. Which fundamental property of a correct program is being violated?
program concept
Medium
A.Modularity
B.Determinism
C.Readability
D.Portability
Correct Answer: Determinism
Explanation:
A correct program should be deterministic: given the same inputs, it must always produce the same outputs. Varying results for identical inputs indicate a violation of determinism.
Incorrect! Try again.
23A developer rewrites a long function into several smaller, self-contained functions. Which programming characteristic is most directly improved?
characteristics of programming
Medium
A.Determinism
B.Finiteness
C.Modularity
D.Efficiency
Correct Answer: Modularity
Explanation:
Breaking a large routine into smaller independent units improves modularity, making the code easier to test, reuse, and maintain.
Incorrect! Try again.
24Two programs solve the same task, but Program A runs in time while Program B runs in time. Which characteristic distinguishes Program A as the better choice for large inputs?
characteristics of programming
Medium
A.Readability
B.Efficiency
C.Reliability
D.Portability
Correct Answer: Efficiency
Explanation:
Efficiency measures how well a program uses time and resources. For large , an solution scales far better than an one.
Incorrect! Try again.
25During program development, a compiler reports that a semicolon is missing. At which stage is this error detected?
stages in program development
Medium
A.Design stage
B.Compilation stage
C.Requirement analysis stage
D.Maintenance stage
Correct Answer: Compilation stage
Explanation:
Syntax errors like a missing semicolon are caught by the compiler during compilation, before the program can be executed.
Incorrect! Try again.
26A program compiles and runs, but gives wrong output because a formula was written incorrectly. This is best classified as which type of error, and it is handled in which stage?
A wrong formula that still compiles and runs produces incorrect results, which is a logical error discovered and fixed during the testing and debugging stage.
Incorrect! Try again.
27Which ordering of program development stages is correct?
stages in program development
Medium
A.Design → Coding → Problem analysis → Maintenance → Testing
B.Coding → Problem analysis → Testing → Design → Maintenance
Development begins by understanding the problem, designing a solution, coding it, testing for correctness, and finally maintaining it over time.
Incorrect! Try again.
28Consider this algorithm step: while (i > 0) { print i; } where i is never changed inside the loop. Which essential property of an algorithm does this violate?
algorithms
Medium
A.Finiteness
B.Input
C.Definiteness
D.Output
Correct Answer: Finiteness
Explanation:
An algorithm must terminate after a finite number of steps. Since i never decreases, the loop runs forever, violating finiteness.
Incorrect! Try again.
29An algorithm contains the instruction "add a suitable number to " without specifying which number. Which property of a good algorithm is missing?
algorithms
Medium
A.Output
B.Definiteness
C.Effectiveness
D.Finiteness
Correct Answer: Definiteness
Explanation:
Definiteness requires each step to be precise and unambiguous. "A suitable number" is vague, so the step is not clearly defined.
Incorrect! Try again.
30Given the algorithm: sum = 0; for i = 1 to 4: sum = sum + i, what is the final value of sum?
algorithms
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
The loop adds , so sum finishes at .
Incorrect! Try again.
31Which of the following expressions is written in postfix (Reverse Polish) notation for the infix expression ?
notations
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
Multiplication has higher precedence, so becomes , then adding gives in postfix form.
Incorrect! Try again.
32The prefix notation of an expression is . Which infix expression does it represent?
notations
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
In prefix, the outer operator applies to and . Since is , the expression is .
Incorrect! Try again.
33While drawing a flowchart, which symbol should be used to represent a decision such as if x > 0?
flowchart
Medium
A.Oval (ellipse)
B.Diamond (rhombus)
C.Parallelogram
D.Rectangle
Correct Answer: Diamond (rhombus)
Explanation:
A diamond represents a decision point with branching paths. Rectangles are for processing, parallelograms for input/output, and ovals for start/stop.
Incorrect! Try again.
34In a flowchart, the parallelogram symbol is used to represent which operation?
flowchart
Medium
A.Input or output
B.A decision
C.A processing step
D.The start or end
Correct Answer: Input or output
Explanation:
The parallelogram denotes input/output operations such as reading data or displaying results, while other symbols handle processing, decisions, and terminals.
Incorrect! Try again.
35A flowchart contains many arrows crossing back to earlier steps, forming complex loops in a large program. Which limitation of flowcharts does this illustrate?
flowchart
Medium
A.They become hard to modify and manage as complexity grows
B.They cannot show any loops
C.They cannot represent decisions
D.They execute faster than code
Correct Answer: They become hard to modify and manage as complexity grows
Explanation:
Flowcharts are good for small logic, but for large programs they become cluttered and difficult to modify or maintain.
Incorrect! Try again.
36A methodology that organizes software around objects containing both data and the functions that operate on them is called:
types of programming methodologies
Medium
A.Procedural programming
B.Object-oriented programming
C.Unstructured programming
D.Machine-level programming
Correct Answer: Object-oriented programming
Explanation:
Object-oriented programming bundles data and behavior into objects, unlike procedural programming which separates data from procedures.
Incorrect! Try again.
37A programmer avoids goto statements and builds a program using only sequence, selection, and iteration constructs. Which methodology is being followed?
types of programming methodologies
Medium
A.Structured programming
B.Object-oriented programming
C.Logic programming
D.Event-driven programming
Correct Answer: Structured programming
Explanation:
Structured programming relies on sequence, selection, and iteration while avoiding unrestricted jumps like goto, improving clarity and reliability.
Incorrect! Try again.
38A design team first builds and tests small utility functions, then combines them into larger modules to form the final system. Which approach is this?
top down and bottom up program development
Medium
A.Top-down approach
B.Bottom-up approach
C.Event-driven design
D.Waterfall analysis
Correct Answer: Bottom-up approach
Explanation:
The bottom-up approach starts with low-level components, testing them first, then integrates them upward into higher-level modules.
Incorrect! Try again.
39In a top-down design of a billing system, the main problem is split into "read data", "calculate bill", and "print bill". This process of dividing a problem into smaller subproblems is called:
top down and bottom up program development
Medium
A.Encapsulation
B.Overloading
C.Stepwise refinement
D.Linking
Correct Answer: Stepwise refinement
Explanation:
Top-down design uses stepwise refinement, breaking a main problem into progressively smaller and more detailed subproblems until they are easy to code.
Incorrect! Try again.
40In a case study, a team must build a large system reusing many existing tested library components. Which development approach is generally most suitable?
top down and bottom up program development
Medium
A.Top-down, because it builds small parts first
B.Bottom-up, because existing components are combined into the whole
C.Top-down, because it ignores existing components
D.Bottom-up, because it starts from the main module
Correct Answer: Bottom-up, because existing components are combined into the whole
Explanation:
When reusable, tested components already exist, the bottom-up approach fits best since it assembles these lower-level parts into the complete system.
Incorrect! Try again.
41Consider the algorithm:
set x = 0
for i from 1 to n:
for j from i to n:
x = x + 1
What is the final value of as a closed-form expression in ?
algorithms
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
The inner loop runs times for each . Summing .
Incorrect! Try again.
42An algorithm must be finite, definite, effective, and have input/output. Which scenario violates the property of definiteness specifically?
algorithms
Hard
A.A loop never terminates for certain inputs
B.A step says "choose a suitable value for x" without specifying how
C.A step requires computing over reals
D.The algorithm produces no output at all
Correct Answer: A step says "choose a suitable value for x" without specifying how
Explanation:
Definiteness requires each step be precisely and unambiguously defined. A vague instruction violates definiteness. Non-termination violates finiteness, and an unperformable step violates effectiveness.
Incorrect! Try again.
43In a flowchart, a program reads , then while replaces with if even, else , counting iterations. For , how many iterations occur before becomes ?
flowchart
Hard
A.6
B.9
C.8
D.7
Correct Answer: 8
Explanation:
Sequence: . That is 8 transitions (iterations) to reach 1.
Incorrect! Try again.
44A team builds a payroll system by first coding and unit-testing utility routines (tax calc, date math), then combining them into modules, and finally into the full application. Which methodology and integration strategy does this reflect?
top down and bottom up program development cycle with case study
Hard
A.Bottom-up development with bottom-up integration testing
B.Bottom-up development with big-bang integration
C.Top-down development with driver-based integration
D.Top-down development with stub-based integration
Correct Answer: Bottom-up development with bottom-up integration testing
Explanation:
Starting from low-level utilities and composing upward is bottom-up development. Testing lower modules first and combining upward (using drivers, not stubs) is bottom-up integration.
Incorrect! Try again.
45Which statement most accurately distinguishes procedural from structured programming?
types of programming methodologies
Hard
A.Procedural programming forbids loops whereas structured programming requires them
B.Structured programming restricts control flow to sequence, selection, and iteration, avoiding arbitrary jumps, while procedural programming organizes code into procedures/functions
C.They are identical terms with no distinction in any context
D.Structured programming forbids the use of functions entirely
Correct Answer: Structured programming restricts control flow to sequence, selection, and iteration, avoiding arbitrary jumps, while procedural programming organizes code into procedures/functions
Explanation:
Structured programming is defined by disciplined control flow (no unrestricted goto). Procedural focuses on decomposing tasks into procedures. They overlap heavily but emphasize different aspects.
Incorrect! Try again.
46During which stage is the root cause of a logical error (correct compilation but wrong output) most appropriately identified and corrected?
stages in program development
Hard
A.Testing and debugging
B.Coding
C.Documentation
D.Problem analysis
Correct Answer: Testing and debugging
Explanation:
A logical error compiles fine but yields incorrect results. It is exposed during testing and resolved during debugging, though its origin may trace to analysis or design decisions.
Incorrect! Try again.
47Two algorithms solve the same problem: A runs in and B runs in . For which range of input sizes is algorithm B strictly faster than A?
algorithms
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
B is faster when , i.e. . For , A becomes faster. Asymptotics favor A, but for small inputs B wins.
Incorrect! Try again.
48Why can an unstructured flowchart containing arbitrary crossing flow lines and multiple entry points into a loop be problematic when translated to structured code?
flowchart
Hard
A.Flowcharts can never be converted into any programming language
B.It guarantees an infinite loop in every case
C.It may require goto or duplicated logic because it cannot map cleanly onto sequence/selection/iteration constructs
D.It always doubles the program's memory usage
Correct Answer: It may require goto or duplicated logic because it cannot map cleanly onto sequence/selection/iteration constructs
Explanation:
Structured programming allows only single-entry/single-exit blocks. Multiple entries into a loop cannot be expressed with pure structured constructs, forcing goto or code duplication.
Incorrect! Try again.
49A program computes correct results but its runtime doubles each time input size increases by one element. Which quality characteristic is most severely compromised?
characteristics of programming
Hard
A.Readability
B.Correctness
C.Portability
D.Efficiency
Correct Answer: Efficiency
Explanation:
Doubling per unit input implies exponential behavior. Results are still correct, so correctness holds; the failing attribute is efficiency (resource/time usage).
Incorrect! Try again.
50Convert the infix expression to postfix notation, respecting standard operator precedence and left-to-right associativity.
notations
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
, then . Then . Finally subtract: .
Incorrect! Try again.
51In top-down development of a large system, why are stubs used during early integration testing?
top down and bottom up program development cycle with case study
Hard
A.To replace the main module with a dummy so nothing runs
B.To permanently remove untested functions from the build
C.To convert the program from procedural to object-oriented style
D.To simulate lower-level modules that are not yet implemented, so higher-level logic can be tested
Correct Answer: To simulate lower-level modules that are not yet implemented, so higher-level logic can be tested
Explanation:
Top-down starts from top-level modules. Stubs are placeholder routines returning canned values, letting higher modules be tested before lower ones exist. Drivers serve the reverse role in bottom-up.
Incorrect! Try again.
52Consider this algorithm on integer :
c = 0
while n > 0:
n = n & (n - 1)
c = c + 1
What does represent when the loop ends?
algorithms
Hard
A.
B.The number of digits in
C.The number of trailing zeros in
D.The number of 1-bits (set bits) in the binary representation of
Correct Answer: The number of 1-bits (set bits) in the binary representation of
Explanation:
The operation n & (n-1) clears the lowest set bit each iteration. The count therefore equals the number of set bits (Brian Kernighan's algorithm).
Incorrect! Try again.
53A completed program passes all developer tests but frequently breaks after client-side changes over the years. Which stage of the program development life cycle is most directly involved in addressing this ongoing situation?
stages in program development
Hard
A.Design
B.Coding
C.Maintenance
D.Testing
Correct Answer: Maintenance
Explanation:
Adapting a working program to changing requirements and environments over time is the maintenance stage, often the longest and costliest phase of the life cycle.
Incorrect! Try again.
54Evaluate the postfix expression 5 1 2 + 4 * + 3 - using a stack. What is the result?
notations
Hard
A.14
B.12
C.10
D.16
Correct Answer: 14
Explanation:
; ; ; . The stack-based evaluation yields 14.
Incorrect! Try again.
55Which statement best explains why a high-level language program cannot be executed directly by the CPU without a translator?
introduction to programming
Hard
A.The CPU only executes machine code (binary instructions), so source code must be compiled or interpreted first
B.High-level programs are always larger than RAM capacity
C.High-level languages contain too many comments for the CPU
D.The CPU lacks enough registers to store variable names
Correct Answer: The CPU only executes machine code (binary instructions), so source code must be compiled or interpreted first
Explanation:
A CPU understands only its native machine instruction set in binary. High-level source must be translated (compiled/interpreted/assembled) into machine code before execution.
Incorrect! Try again.
56A student claims: "A program and an algorithm are exactly the same thing." What is the most accurate correction?
program concept
Hard
A.A program is language-independent while an algorithm is language-specific
B.There is no difference; the terms are fully interchangeable
C.An algorithm must always be longer than the equivalent program
D.An algorithm is a language-independent finite procedure; a program is its concrete implementation in a specific programming language
Correct Answer: An algorithm is a language-independent finite procedure; a program is its concrete implementation in a specific programming language
Explanation:
An algorithm is an abstract step-by-step method independent of any language. A program expresses that algorithm in a concrete syntax executable by a machine.
Incorrect! Try again.
57A flowchart uses a diamond symbol with one entry and two exits labeled True/False. Which fundamental structured-programming construct does this represent, and what is the risk if one exit path is left unconnected?
flowchart
Hard
A.Input/output; an unconnected exit prints garbage
B.Sequence; an unconnected exit has no effect
C.Selection (decision); an unconnected exit causes undefined/incomplete control flow
D.Iteration; an unconnected exit merely slows execution
Correct Answer: Selection (decision); an unconnected exit causes undefined/incomplete control flow
Explanation:
A diamond is the decision (selection) symbol. Every branch must lead somewhere; leaving a path unconnected produces incomplete, undefined flow of control.
Incorrect! Try again.
58Two correct programs solve the same task. Program X uses cryptic single-letter names and no comments; Program Y is well-structured and documented. Both run identically fast. Which characteristic most justifies preferring Y in a long-lived project?
characteristics of programming
Hard
A.Correctness
B.Reliability
C.Maintainability
D.Efficiency
Correct Answer: Maintainability
Explanation:
Since both are equally correct and fast, the differentiator is how easily the code can be understood and modified over time, which is maintainability.
Incorrect! Try again.
59Which combination of features uniquely characterizes the object-oriented methodology as opposed to purely structured/procedural approaches?
types of programming methodologies
Hard
A.Exclusive use of goto for control transfer
B.Decomposition of a task into standalone functions only
C.Encapsulation, inheritance, and polymorphism organized around objects
D.Only sequence, selection, and iteration constructs
Correct Answer: Encapsulation, inheritance, and polymorphism organized around objects
Explanation:
Object-oriented programming is distinguished by bundling data and behavior into objects and by encapsulation, inheritance, and polymorphism, unlike procedural/structured styles.
Incorrect! Try again.
60For an ATM software case study, module reuse across many banks is a top priority and the low-level transaction primitives are well understood. Which development approach is most advantageous, and why?
top down and bottom up program development cycle with case study
Hard
A.Bottom-up, because it eliminates the need for any design phase
B.Bottom-up, because reusable, well-tested low-level modules are built first and combined into varied higher systems
C.Top-down, because low-level modules are irrelevant to reuse
D.Top-down, because it forbids code reuse entirely
Correct Answer: Bottom-up, because reusable, well-tested low-level modules are built first and combined into varied higher systems
Explanation:
When robust, reusable primitives are the goal and are well understood, bottom-up excels: solid low-level components are built and tested first, then assembled into different higher-level systems.
Incorrect! Try again.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. 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.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it.
What it pays for →