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 10 MCQsProgramming Languages and Programming Process
DECAP145 ·
60 questions. Pick an option to check it.
Question 1 of 60 · Categories of Programming Languages · Easy
Programming languages are broadly classified into which two main categories?
Not quite. Try another option.
Answer: Low-level and high-level languages
Programming languages are broadly divided into low-level languages (machine and assembly) and high-level languages that are closer to human language.
Question 2 of 60 · Categories of Programming Languages · Easy
Which of the following is considered a low-level language?
Not quite. Try another option.
Answer: Assembly language
Assembly language is a low-level language because it works closely with the computer hardware, unlike high-level languages such as Python or Java.
Question 3 of 60 · Machine and Assembly Language · Easy
Machine language is written using which of the following?
Not quite. Try another option.
Answer: Binary digits (0s and 1s)
Machine language is the only language the computer directly understands, and it is written entirely in binary form using 0s and 1s.
Question 4 of 60 · Machine and Assembly Language · Easy
Which of the following is used in assembly language instead of binary code?
Not quite. Try another option.
Answer: Mnemonics
Assembly language uses short symbolic codes called mnemonics (like ADD, MOV) that are easier for humans to remember than binary.
Question 5 of 60 · Machine and Assembly Language · Easy
What is the name of the translator that converts assembly language into machine language?
Not quite. Try another option.
Answer: Assembler
An assembler is a program that translates assembly language instructions into machine code that the computer can execute.
Question 6 of 60 · Machine and Assembly Language · Easy
Which statement about machine language is correct?
Not quite. Try another option.
Answer: It is machine-dependent
Machine language is specific to a particular processor's architecture, making it machine-dependent and not portable across different systems.
Question 7 of 60 · Higher Level Languages · Easy
High-level languages are closer to which of the following?
Not quite. Try another option.
Answer: Human language
High-level languages use English-like statements and syntax, making them closer to human language and easier to learn.
Question 8 of 60 · Higher Level Languages · Easy
Which of the following is a high-level programming language?
Not quite. Try another option.
Answer: Python
Python is a popular high-level language that uses readable, English-like syntax, unlike low-level machine or assembly code.
Question 9 of 60 · Higher Level Languages · Easy
Which translator converts a high-level program into machine code all at once?
Not quite. Try another option.
Answer: Compiler
A compiler translates the entire high-level source code into machine code in one step before the program is run.
Question 10 of 60 · Higher Level Languages · Easy
Which translator executes a high-level program line by line?
Not quite. Try another option.
Answer: Interpreter
An interpreter translates and executes a high-level program one statement at a time rather than all at once.
Question 11 of 60 · Higher Level Languages · Easy
A key advantage of high-level languages over low-level languages is that they are:
Not quite. Try another option.
Answer: More portable across machines
High-level languages are machine-independent, so the same program can run on different computers with the right translator, making them portable.
Question 12 of 60 · WWW development languages · Easy
What does HTML stand for?
Not quite. Try another option.
Answer: HyperText Markup Language
HTML stands for HyperText Markup Language and is used to structure the content of web pages.
Question 13 of 60 · WWW development languages · Easy
Which language is mainly used to style and format the appearance of web pages?
Not quite. Try another option.
Answer: CSS
CSS (Cascading Style Sheets) controls the layout, colors, fonts, and overall visual presentation of web pages.
Question 14 of 60 · WWW development languages · Easy
Which language is commonly used to add interactivity to web pages in the browser?
Not quite. Try another option.
Answer: JavaScript
JavaScript is a client-side scripting language that adds interactive behavior to web pages, such as form validation and dynamic content.
Question 15 of 60 · WWW development languages · Easy
In web development, HTML is primarily responsible for a web page's:
Not quite. Try another option.
Answer: Structure and content
HTML defines the structure and content of a web page using elements like headings, paragraphs, and links.
Question 16 of 60 · WWW development languages · Easy
Which of the following is a server-side scripting language used in web development?
Not quite. Try another option.
Answer: PHP
PHP is a server-side scripting language used to build dynamic web pages by processing requests on the server before sending output to the browser.
Question 17 of 60 · The SDLC of Programming · Easy
What does SDLC stand for?
Not quite. Try another option.
Answer: Software Development Life Cycle
SDLC stands for Software Development Life Cycle, the structured process used to plan, create, test, and deploy software.
Question 18 of 60 · The SDLC of Programming · Easy
Which phase of the SDLC involves gathering what the software should do?
Not quite. Try another option.
Answer: Requirement analysis
The requirement analysis phase focuses on identifying and documenting what the software needs to accomplish before design begins.
Question 19 of 60 · The SDLC of Programming · Easy
In the SDLC, which phase is concerned with finding and fixing errors in the program?
Not quite. Try another option.
Answer: Testing
The testing phase checks the software for errors and ensures it meets the requirements before it is released.
Question 20 of 60 · The SDLC of Programming · Easy
Which SDLC phase takes place after the software has been deployed to keep it running correctly?
Not quite. Try another option.
Answer: Maintenance
The maintenance phase occurs after deployment and involves updating, fixing, and improving the software over time.
Question 21 of 60 · Categories of Programming Languages · Medium
A team is building firmware that must directly control hardware registers with minimal overhead, yet they still want some human-readable mnemonics. Which language category best fits this need?
Not quite. Try another option.
Answer: Assembly language
Assembly uses mnemonics that map almost one-to-one to machine instructions, giving low-level hardware control while remaining more readable than raw binary.
Question 22 of 60 · Categories of Programming Languages · Medium
Languages are often classified as low-level or high-level. What is the primary basis for this classification?
Not quite. Try another option.
Answer: The degree of abstraction from the hardware
Low-level languages stay close to hardware details, while high-level languages abstract them away with human-friendly constructs.
Question 23 of 60 · Categories of Programming Languages · Medium
A developer says their code describes what result is wanted rather than how to compute it step by step. Which paradigm are they using?
Not quite. Try another option.
Answer: Declarative programming
Declarative languages (like SQL) specify the desired outcome, whereas imperative/procedural styles specify explicit control-flow steps.
Question 24 of 60 · Machine and Assembly Language · Medium
Which statement correctly describes the relationship between machine language and the CPU?
Not quite. Try another option.
Answer: Machine language is the only form the CPU executes directly
The CPU executes binary machine instructions directly; all other languages must eventually be translated into machine code.
Question 25 of 60 · Machine and Assembly Language · Medium
An assembler is used to convert an assembly program into an executable form. What is its main function?
Not quite. Try another option.
Answer: Translate mnemonic instructions into machine code
An assembler translates symbolic assembly mnemonics into the binary machine instructions the processor can run.
Question 26 of 60 · Machine and Assembly Language · Medium
Why is assembly code generally not portable between different processor families?
Not quite. Try another option.
Answer: It is tied to a specific instruction set architecture
Assembly mnemonics correspond to a particular CPU's instruction set, so code written for one architecture will not run on another.
Question 27 of 60 · Machine and Assembly Language · Medium
In assembly language, a label such as LOOP: is primarily used to:
Not quite. Try another option.
Answer: Mark a memory address that can be referenced
Labels name a location in code or data so instructions like jumps and branches can reference it symbolically instead of by raw address.
Question 28 of 60 · Higher Level Languages · Medium
A compiled language and an interpreted language both start from source code. What is a key runtime difference?
Not quite. Try another option.
Answer: Compiled code runs as prebuilt machine code, interpreted code is translated during execution
Compilation produces machine code ahead of time; interpretation translates instructions on the fly, which usually trades speed for flexibility.
Question 29 of 60 · Higher Level Languages · Medium
A student runs a Java program on both Windows and Linux without recompiling. Which feature makes this possible?
Not quite. Try another option.
Answer: Bytecode executed by the Java Virtual Machine
Java compiles to platform-independent bytecode, which the JVM on each system interprets or JIT-compiles, enabling "write once, run anywhere."
Question 30 of 60 · Higher Level Languages · Medium
Which characteristic is most associated with object-oriented high-level languages?
Not quite. Try another option.
Answer: Bundling data and behavior into classes and objects
Object-oriented languages organize code around objects that encapsulate both state (data) and behavior (methods).
Question 31 of 60 · Higher Level Languages · Medium
A key advantage of high-level languages over assembly is that they:
Not quite. Try another option.
Answer: Improve programmer productivity and portability
High-level languages abstract hardware details, making code easier to write, read, and move across platforms, though a translator is still required.
Question 32 of 60 · Higher Level Languages · Medium
During compilation, which phase is responsible for checking that statements follow the grammar rules of the language?
Not quite. Try another option.
Answer: Syntax analysis (parsing)
The parser (syntax analysis) verifies that the sequence of tokens conforms to the language grammar and builds a parse/syntax tree.
Question 33 of 60 · WWW development languages · Medium
A web page displays headings and paragraphs but has no styling or interactivity. Which language is responsible for that structure?
Not quite. Try another option.
Answer: HTML
HTML defines the structure and content of a page; CSS handles styling and JavaScript adds interactivity.
Question 34 of 60 · WWW development languages · Medium
A developer wants to change the color and layout of many pages from one central file. Which technology is designed for this?
Not quite. Try another option.
Answer: CSS
CSS separates presentation from content, so a single stylesheet can control the look of many HTML pages at once.
Question 35 of 60 · WWW development languages · Medium
Code that runs on the web server to generate a page before sending it to the browser is called:
Not quite. Try another option.
Answer: Server-side scripting
Server-side scripts (like PHP or Node.js) execute on the server to build responses, unlike client-side JavaScript that runs in the browser.
Question 36 of 60 · WWW development languages · Medium
Which pairing correctly matches a task to the appropriate web language?
Not quite. Try another option.
Answer: Validating a form without reloading the page — JavaScript
JavaScript runs in the browser and can validate input dynamically; HTML structures content and CSS styles it.
Question 37 of 60 · WWW development languages · Medium
Why is JavaScript often described as a client-side language in traditional web development?
Not quite. Try another option.
Answer: It typically executes inside the user's browser
Classic JavaScript runs in the browser (client), manipulating the DOM and responding to user actions, though it can also run server-side via Node.js.
Question 38 of 60 · The SDLC of Programming · Medium
A project team gathers user needs and documents what the software must do before any design begins. Which SDLC phase is this?
Not quite. Try another option.
Answer: Requirements analysis
Requirements analysis captures and documents what the system must accomplish, forming the basis for design and later phases.
Question 39 of 60 · The SDLC of Programming · Medium
During which SDLC phase is source code actually written based on the design specifications?
Not quite. Try another option.
Answer: Implementation (coding)
The implementation phase translates the design into working source code using a chosen programming language.
Question 40 of 60 · The SDLC of Programming · Medium
A defect discovered after the software is released to users is fixed and a patch is issued. This activity belongs to which SDLC phase?
Not quite. Try another option.
Answer: Maintenance
Post-release fixes, updates, and enhancements fall under the maintenance phase of the SDLC.
Question 41 of 60 · Categories of Programming Languages · Hard
A developer claims that a purely declarative language cannot express iteration. Which counter-argument most accurately refutes this claim?
Not quite. Try another option.
Answer: Declarative languages express repetition through recursion and set-based operations rather than explicit loop counters
Declarative paradigms (functional, logic, query) describe what is computed. Repetition is achieved via recursion or operations over whole sets/relations, not by mutating a loop counter, so iteration is expressible without imperative loops.
Question 42 of 60 · Categories of Programming Languages · Hard
Consider four generations of languages (1GL–4GL). Which ordering correctly ranks them from lowest to highest level of abstraction?
Not quite. Try another option.
Answer: Machine code, assembly, procedural high-level, non-procedural query languages
1GL is machine code, 2GL is assembly, 3GL is procedural high-level (C, Java), and 4GL is non-procedural (SQL, report generators). Abstraction increases across the generations in that order.
Question 43 of 60 · Machine and Assembly Language · Hard
An assembler encounters a forward reference to a label that is defined later in the source. How does a two-pass assembler resolve this?
Not quite. Try another option.
Answer: The first pass builds a symbol table of all labels, and the second pass substitutes their resolved addresses
A two-pass assembler uses pass one to record every label and its address in a symbol table, then pass two emits object code, substituting the now-known addresses for both forward and backward references.
Question 44 of 60 · Machine and Assembly Language · Hard
Why does the same assembly source program generally fail to run unmodified on two processors with different instruction set architectures (ISAs)?
Not quite. Try another option.
Answer: Assembly mnemonics map to ISA-specific opcodes and register sets that differ between processors
Assembly is a symbolic form of a specific machine language. Each ISA defines its own opcodes, registers, and addressing modes, so assembly written for one ISA has no valid translation on another without a rewrite.
Question 45 of 60 · Machine and Assembly Language · Hard
A machine instruction is stored as the 8-bit pattern . If the high 3 bits are the opcode and the low 5 bits are an operand, what are the opcode and operand values in decimal?
Not quite. Try another option.
Answer: Opcode , operand
High 3 bits ; low 5 bits . So opcode is and operand is .
Question 46 of 60 · Higher Level Languages · Hard
A language is described as compiled to bytecode and then executed by a virtual machine with just-in-time (JIT) compilation. Which statement about its execution model is most accurate?
Not quite. Try another option.
Answer: Frequently executed bytecode is compiled to native machine code at runtime to improve performance
A JIT compiler identifies hot paths (frequently executed bytecode) and compiles them to native code during execution, combining portability of bytecode with the speed of native code for hot regions.
Question 47 of 60 · Higher Level Languages · Hard
Consider strongly-typed versus weakly-typed high-level languages. Which scenario best illustrates a bug that strong static typing would catch at compile time but weak dynamic typing would not?
Not quite. Try another option.
Answer: Adding a numeric string to an integer produces silent implicit coercion instead of a type error
Weak dynamic typing may implicitly coerce a string to a number (or vice versa) and continue, hiding a logic error. Strong static typing rejects the mismatch at compile time. The other issues are runtime/logic faults unrelated to type checking.
Question 48 of 60 · Higher Level Languages · Hard
A team debates using an interpreted versus a compiled language for a performance-critical numerical engine. Which tradeoff most accurately captures the core distinction?
Not quite. Try another option.
Answer: Compilation produces optimized native code once, while interpretation re-analyzes source each run, usually costing runtime speed
Compilers translate and optimize ahead of time into native code, favoring runtime speed. Interpreters process source repeatedly at execution, trading raw speed for flexibility. For performance-critical numerics, compilation typically wins.
Question 49 of 60 · Higher Level Languages · Hard
Which characteristic distinguishes an object-oriented high-level language from a purely procedural one in terms of how state and behavior are organized?
Not quite. Try another option.
Answer: Data and the operations acting on it are encapsulated together into objects rather than separated into structures and free functions
The defining OO trait is encapsulation: bundling state (data) with the methods that operate on it inside objects. Procedural code typically keeps data structures and functions separate. The other statements are false.
Question 50 of 60 · WWW development languages · Hard
A web page renders correctly but a screen reader cannot interpret its structure. Considering the roles of HTML, CSS, and JavaScript, which is the most likely root cause?
Not quite. Try another option.
Answer: Visual layout was achieved with non-semantic elements and CSS instead of semantic HTML structure
Screen readers rely on semantic HTML (headings, landmarks, lists) to convey structure. If layout is faked with generic div/span styled by CSS, the visual result is fine but the accessibility tree is meaningless. Semantics live in HTML, not CSS.
Question 51 of 60 · WWW development languages · Hard
In the client-server model of web development, which task is inherently a server-side responsibility that cannot be securely delegated to client-side JavaScript alone?
Not quite. Try another option.
Answer: Validating and authorizing access to protected data before returning it
Client-side code is fully visible and modifiable by the user, so authorization and trusted validation must occur server-side. Purely presentational effects (hover, animation, reordering) are legitimately handled on the client.
Question 52 of 60 · WWW development languages · Hard
A developer stores rendered HTML from user input directly into the DOM using innerHTML without sanitization. Which vulnerability class does this most directly introduce?
Not quite. Try another option.
Answer: Cross-site scripting (XSS) through injection of executable markup
Injecting unsanitized user input via innerHTML allows an attacker to embed <script> or event-handler markup that the browser executes—classic reflected/stored XSS. Sanitizing or using text nodes prevents it.
Question 53 of 60 · WWW development languages · Hard
Comparing server-side rendering (SSR) with client-side rendering (CSR) for initial page load, which statement is most accurate?
Not quite. Try another option.
Answer: SSR sends fully-formed HTML so first meaningful paint is usually faster, while CSR shifts rendering work to the browser after a JavaScript download
SSR delivers ready HTML, improving initial paint and often SEO. CSR downloads a JS bundle and builds the DOM in the browser, delaying first meaningful paint. SSR can still hydrate with client-side JS afterward.
Question 54 of 60 · The SDLC of Programming · Hard
A project has volatile, frequently changing requirements and requires continuous stakeholder feedback. Which SDLC model is least suitable, and why?
Not quite. Try another option.
Answer: Waterfall, because its sequential phases resist changes once a phase is completed
Waterfall locks requirements early and flows strictly forward, making late changes costly. Agile, Spiral, and Iterative models are all built to accommodate evolving requirements and feedback, so Waterfall is the poor fit here.
Question 55 of 60 · The SDLC of Programming · Hard
The cost of fixing a defect discovered during the maintenance phase is often cited as far greater than one found during requirements analysis. Which principle best explains this escalation?
Not quite. Try another option.
Answer: Defects propagate through later phases, so fixing them late requires reworking design, code, and tests built on the flawed assumption
An error made early is inherited by every downstream artifact. Fixing it late means undoing and redoing design, implementation, and testing that were built on it—hence the sharply rising cost curve.
Question 56 of 60 · The SDLC of Programming · Hard
During which SDLC phase is the decision between build-vs-buy and the technical architecture (languages, platforms, data flow) most appropriately finalized?
Not quite. Try another option.
Answer: System/software design, after requirements are analyzed but before coding begins
Architecture and build-vs-buy choices belong to the design phase: requirements define what is needed, and design decides how—platforms, structure, and data flow—before implementation starts.
Question 57 of 60 · The SDLC of Programming · Hard
A team using the Spiral model completes a prototype and identifies a high-risk integration point. According to the model, what happens next in the cycle?
Not quite. Try another option.
Answer: Risk analysis drives the next iteration, where the identified risk is evaluated and mitigated before further engineering
The Spiral model's defining feature is repeated risk-driven iteration. Each loop includes objective-setting, risk analysis/mitigation, engineering, and planning the next loop—so an identified risk is tackled in the following cycle.
Question 58 of 60 · The SDLC of Programming · Hard
Two SDLC approaches are compared: one delivers the entire system in a single release; the other delivers working increments repeatedly. Which is a genuine advantage of the incremental approach for a large enterprise system?
Not quite. Try another option.
Answer: Early increments deliver usable functionality and expose integration issues sooner, reducing late-stage surprises
Incremental delivery puts working software in users' hands early and surfaces integration and requirement problems while they are cheaper to fix. It does not remove testing, guarantee lower cost, or skip requirements.
Question 59 of 60 · Categories of Programming Languages · Hard
A logic programming language (e.g., Prolog) is asked to solve a problem by stating facts and rules rather than steps. Which best describes how it produces an answer?
Not quite. Try another option.
Answer: An inference engine searches for variable bindings that satisfy the goal against the declared facts and rules
Logic languages are declarative: you state facts and rules, and an inference engine uses unification and backtracking to find bindings that make the query true. Control flow is implicit in the search, not written as loops.
Question 60 of 60 · Categories of Programming Languages · Hard
Why is it inaccurate to call a language like Python "purely interpreted" even though it is commonly grouped with scripting languages?
Not quite. Try another option.
Answer: Its source is first compiled to bytecode, which a virtual machine then executes
Many "interpreted" languages compile source to an intermediate bytecode that a virtual machine interprets/executes. So the pipeline includes a compilation step, making the "purely interpreted" label imprecise.
That's unit 10
Answer a few questions and your score shows up here.
Nearly through. Did unit 10 of DECAP145 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 10 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.