Unit 10: Programming Languages and Programming Process - Practice Quiz

DECAP145 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 Programming languages are broadly classified into which two main categories?

Categories of Programming Languages Easy
A. Low-level and high-level languages
B. Old and new languages
C. Text and visual languages
D. Simple and complex languages

2 Which of the following is considered a low-level language?

Categories of Programming Languages Easy
A. Python
B. Java
C. C++
D. Assembly language

3 Machine language is written using which of the following?

Machine and Assembly Language Easy
A. Decimal numbers
B. English words
C. Mnemonic codes
D. Binary digits (0s and 1s)

4 Which of the following is used in assembly language instead of binary code?

Machine and Assembly Language Easy
A. Decimals
B. Hyperlinks
C. Compilers
D. Mnemonics

5 What is the name of the translator that converts assembly language into machine language?

Machine and Assembly Language Easy
A. Interpreter
B. Linker
C. Compiler
D. Assembler

6 Which statement about machine language is correct?

Machine and Assembly Language Easy
A. It needs no execution
B. It is machine-dependent
C. It uses English keywords
D. It is easy for humans to read

7 High-level languages are closer to which of the following?

Higher Level Languages Easy
A. Machine hardware
B. Electrical signals
C. Human language
D. Binary code

8 Which of the following is a high-level programming language?

Higher Level Languages Easy
A. Machine code
B. Assembly
C. Binary
D. Python

9 Which translator converts a high-level program into machine code all at once?

Higher Level Languages Easy
A. Debugger
B. Assembler
C. Editor
D. Compiler

10 Which translator executes a high-level program line by line?

Higher Level Languages Easy
A. Compiler
B. Assembler
C. Loader
D. Interpreter

11 A key advantage of high-level languages over low-level languages is that they are:

Higher Level Languages Easy
A. Written in binary
B. Understood directly by the CPU
C. More portable across machines
D. Faster than machine code

12 What does HTML stand for?

WWW development languages Easy
A. Home Tool Markup Language
B. Hyperlink Text Marking Language
C. High Text Machine Language
D. HyperText Markup Language

13 Which language is mainly used to style and format the appearance of web pages?

WWW development languages Easy
A. PHP
B. SQL
C. HTML
D. CSS

14 Which language is commonly used to add interactivity to web pages in the browser?

WWW development languages Easy
A. C
B. COBOL
C. JavaScript
D. FORTRAN

15 In web development, HTML is primarily responsible for a web page's:

WWW development languages Easy
A. Structure and content
B. Server configuration
C. Colors and fonts
D. Database queries

16 Which of the following is a server-side scripting language used in web development?

WWW development languages Easy
A. PHP
B. HTML
C. CSS
D. XML

17 What does SDLC stand for?

The SDLC of Programming Easy
A. Standard Development Logic Cycle
B. Software Development Life Cycle
C. System Data Logic Control
D. Software Design Language Code

18 Which phase of the SDLC involves gathering what the software should do?

The SDLC of Programming Easy
A. Testing
B. Requirement analysis
C. Coding
D. Maintenance

19 In the SDLC, which phase is concerned with finding and fixing errors in the program?

The SDLC of Programming Easy
A. Planning
B. Testing
C. Deployment
D. Design

20 Which SDLC phase takes place after the software has been deployed to keep it running correctly?

The SDLC of Programming Easy
A. Coding
B. Maintenance
C. Design
D. Analysis

21 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?

Categories of Programming Languages Medium
A. Scripting language
B. Fourth-generation language (4GL)
C. Query language
D. Assembly language

22 Languages are often classified as low-level or high-level. What is the primary basis for this classification?

Categories of Programming Languages Medium
A. The number of keywords in the language
B. The age of the language
C. The speed of the compiler used
D. The degree of abstraction from the hardware

23 A developer says their code describes what result is wanted rather than how to compute it step by step. Which paradigm are they using?

Categories of Programming Languages Medium
A. Imperative programming
B. Declarative programming
C. Assembly programming
D. Procedural programming

24 Which statement correctly describes the relationship between machine language and the CPU?

Machine and Assembly Language Medium
A. Machine language is the only form the CPU executes directly
B. Machine language must be interpreted line by line at runtime
C. Machine language is portable across all CPU types
D. Machine language is written using English keywords

25 An assembler is used to convert an assembly program into an executable form. What is its main function?

Machine and Assembly Language Medium
A. Optimize high-level code into bytecode
B. Translate mnemonic instructions into machine code
C. Manage runtime memory allocation
D. Interpret source code line by line

26 Why is assembly code generally not portable between different processor families?

Machine and Assembly Language Medium
A. It cannot be assembled without the internet
B. It uses too many high-level abstractions
C. It is always encrypted for one machine
D. It is tied to a specific instruction set architecture

27 In assembly language, a label such as LOOP: is primarily used to:

Machine and Assembly Language Medium
A. Mark a memory address that can be referenced
B. Define the program's entry point only
C. Comment out a block of code
D. Reserve space for a global variable

28 A compiled language and an interpreted language both start from source code. What is a key runtime difference?

Higher Level Languages Medium
A. Compiled code needs the source each time it runs
B. Interpreted code cannot use variables
C. Interpreted code always runs faster than compiled code
D. Compiled code runs as prebuilt machine code, interpreted code is translated during execution

29 A student runs a Java program on both Windows and Linux without recompiling. Which feature makes this possible?

Higher Level Languages Medium
A. Bytecode executed by the Java Virtual Machine
B. Use of platform-specific header files
C. Direct compilation to each OS's machine code
D. Automatic conversion to assembly at install

30 Which characteristic is most associated with object-oriented high-level languages?

Higher Level Languages Medium
A. Direct manipulation of CPU registers
B. Executing instructions strictly top to bottom
C. Bundling data and behavior into classes and objects
D. Describing results without any procedures

31 A key advantage of high-level languages over assembly is that they:

Higher Level Languages Medium
A. Improve programmer productivity and portability
B. Give direct access to every hardware register
C. Eliminate the need for any translation
D. Always produce faster executables

32 During compilation, which phase is responsible for checking that statements follow the grammar rules of the language?

Higher Level Languages Medium
A. Syntax analysis (parsing)
B. Lexical analysis only
C. Code optimization
D. Linking

33 A web page displays headings and paragraphs but has no styling or interactivity. Which language is responsible for that structure?

WWW development languages Medium
A. JavaScript
B. SQL
C. HTML
D. CSS

34 A developer wants to change the color and layout of many pages from one central file. Which technology is designed for this?

WWW development languages Medium
A. XML
B. HTML
C. CSS
D. PHP

35 Code that runs on the web server to generate a page before sending it to the browser is called:

WWW development languages Medium
A. Markup rendering
B. Client-side scripting
C. Style casting
D. Server-side scripting

36 Which pairing correctly matches a task to the appropriate web language?

WWW development languages Medium
A. Validating a form without reloading the page — JavaScript
B. Styling text color — HTML
C. Adding interactivity — SQL
D. Defining page structure — CSS

37 Why is JavaScript often described as a client-side language in traditional web development?

WWW development languages Medium
A. It only runs on database servers
B. It cannot access page elements
C. It compiles to machine code before download
D. It typically executes inside the user's browser

38 A project team gathers user needs and documents what the software must do before any design begins. Which SDLC phase is this?

The SDLC of Programming Medium
A. Maintenance
B. Testing
C. Requirements analysis
D. Implementation

39 During which SDLC phase is source code actually written based on the design specifications?

The SDLC of Programming Medium
A. Design
B. Implementation (coding)
C. Requirements analysis
D. Deployment

40 A defect discovered after the software is released to users is fixed and a patch is issued. This activity belongs to which SDLC phase?

The SDLC of Programming Medium
A. Design
B. Maintenance
C. Requirements analysis
D. Testing

41 A developer claims that a purely declarative language cannot express iteration. Which counter-argument most accurately refutes this claim?

Categories of Programming Languages Hard
A. Declarative languages always use while constructs hidden by syntax sugar
B. Declarative languages cannot process collections, so iteration is irrelevant
C. Declarative languages express repetition through recursion and set-based operations rather than explicit loop counters
D. Declarative languages compile to imperative bytecode, so loops exist internally

42 Consider four generations of languages (1GL–4GL). Which ordering correctly ranks them from lowest to highest level of abstraction?

Categories of Programming Languages Hard
A. Query languages, procedural high-level, machine code, assembly
B. Assembly, machine code, query languages, procedural high-level
C. Procedural high-level, assembly, machine code, query languages
D. Machine code, assembly, procedural high-level, non-procedural query languages

43 An assembler encounters a forward reference to a label that is defined later in the source. How does a two-pass assembler resolve this?

Machine and Assembly Language Hard
A. It halts and reports an error because forward references are illegal
B. The first pass builds a symbol table of all labels, and the second pass substitutes their resolved addresses
C. The first pass generates object code and the second pass deletes unused labels
D. It resolves the reference at runtime using dynamic linking

44 Why does the same assembly source program generally fail to run unmodified on two processors with different instruction set architectures (ISAs)?

Machine and Assembly Language Hard
A. Assembly stores data in decimal, which processors read differently
B. Assembly is interpreted, so timing differences cause failures
C. Assembly lacks comments, which each processor requires differently
D. Assembly mnemonics map to ISA-specific opcodes and register sets that differ between processors

45 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?

Machine and Assembly Language Hard
A. Opcode , operand
B. Opcode , operand
C. Opcode , operand
D. Opcode , operand

46 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?

Higher Level Languages Hard
A. All bytecode is translated to native code before the program starts, eliminating the VM
B. Bytecode is interpreted line by line and never converted to native code
C. Frequently executed bytecode is compiled to native machine code at runtime to improve performance
D. The source is compiled directly to native code, bypassing bytecode

47 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?

Higher Level Languages Hard
A. A null pointer is dereferenced during recursion
B. A file is opened but never closed, causing a resource leak
C. Adding a numeric string to an integer produces silent implicit coercion instead of a type error
D. An infinite loop consumes all available memory

48 A team debates using an interpreted versus a compiled language for a performance-critical numerical engine. Which tradeoff most accurately captures the core distinction?

Higher Level Languages Hard
A. Interpretation always produces faster binaries but larger source files
B. Compilation produces optimized native code once, while interpretation re-analyzes source each run, usually costing runtime speed
C. Interpreted code cannot access hardware, while compiled code cannot be debugged
D. Compilation prevents any portability, while interpretation guarantees native speed

49 Which characteristic distinguishes an object-oriented high-level language from a purely procedural one in terms of how state and behavior are organized?

Higher Level Languages Hard
A. Data and the operations acting on it are encapsulated together into objects rather than separated into structures and free functions
B. OO languages compile faster because they omit type information
C. Procedural languages cannot use functions, whereas OO languages can
D. Objects eliminate the need for variables by storing everything in registers

50 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?

WWW development languages Hard
A. The CSS file failed to load, breaking accessibility
B. Visual layout was achieved with non-semantic elements and CSS instead of semantic HTML structure
C. JavaScript was minified, hiding the DOM from assistive tools
D. HTTPS encryption blocked the screen reader from parsing text

51 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?

WWW development languages Hard
A. Validating and authorizing access to protected data before returning it
B. Animating a dropdown menu
C. Changing the color of a button on hover
D. Reordering a list without a page reload

52 A developer stores rendered HTML from user input directly into the DOM using innerHTML without sanitization. Which vulnerability class does this most directly introduce?

WWW development languages Hard
A. SQL injection through the database layer
B. Denial of service by exhausting CPU
C. Buffer overflow in the browser heap
D. Cross-site scripting (XSS) through injection of executable markup

53 Comparing server-side rendering (SSR) with client-side rendering (CSR) for initial page load, which statement is most accurate?

WWW development languages Hard
A. CSR always produces faster first paint because the server does no work
B. SSR eliminates the need for any client-side JavaScript entirely
C. SSR sends fully-formed HTML so first meaningful paint is usually faster, while CSR shifts rendering work to the browser after a JavaScript download
D. SSR cannot be indexed by search engines, unlike CSR

54 A project has volatile, frequently changing requirements and requires continuous stakeholder feedback. Which SDLC model is least suitable, and why?

The SDLC of Programming Hard
A. Agile, because it cannot handle changing requirements
B. Spiral, because it ignores risk analysis
C. Iterative, because it forbids feedback between cycles
D. Waterfall, because its sequential phases resist changes once a phase is completed

55 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?

The SDLC of Programming Hard
A. Requirements defects never affect code, so they are free to fix
B. Late defects are always in hardware rather than software
C. Defects propagate through later phases, so fixing them late requires reworking design, code, and tests built on the flawed assumption
D. Maintenance engineers are paid more than analysts

56 During which SDLC phase is the decision between build-vs-buy and the technical architecture (languages, platforms, data flow) most appropriately finalized?

The SDLC of Programming Hard
A. Testing, once the code is complete
B. System/software design, after requirements are analyzed but before coding begins
C. Requirements gathering, before any analysis is done
D. Deployment, when the system goes live

57 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?

The SDLC of Programming Hard
A. Risk analysis drives the next iteration, where the identified risk is evaluated and mitigated before further engineering
B. Risk is ignored until the maintenance phase
C. The spiral restarts from scratch, discarding all prior work
D. The project immediately moves to final deployment

58 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?

The SDLC of Programming Hard
A. Early increments deliver usable functionality and expose integration issues sooner, reducing late-stage surprises
B. It removes the need for testing because increments are small
C. It guarantees the total cost will be lower than any other model
D. It eliminates the requirements phase entirely

59 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?

Categories of Programming Languages Hard
A. The interpreter ignores rules and only returns stored facts
B. The runtime executes each fact as a function call in the order written
C. A compiler converts the rules into sequential loops executed top to bottom
D. An inference engine searches for variable bindings that satisfy the goal against the declared facts and rules

60 Why is it inaccurate to call a language like Python "purely interpreted" even though it is commonly grouped with scripting languages?

Categories of Programming Languages Hard
A. It never runs source code, only precompiled binaries
B. It is translated directly to machine code with no intermediate form
C. Its source is first compiled to bytecode, which a virtual machine then executes
D. Its interpreter converts each character to assembly individually