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. Text and visual languages
B. Simple and complex languages
C. Old and new languages
D. Low-level and high-level 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. Mnemonic codes
C. Binary digits (0s and 1s)
D. English words

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

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

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

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

6 Which statement about machine language is correct?

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

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

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

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

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

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

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

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. More portable across machines
B. Understood directly by the CPU
C. Faster than machine code
D. Written in binary

12 What does HTML stand for?

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

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

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

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

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

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

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

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

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

17 What does SDLC stand for?

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

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

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

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

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

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

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

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. Assembly language
B. Query language
C. Fourth-generation language (4GL)
D. Scripting 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 degree of abstraction from the hardware
B. The age of the language
C. The speed of the compiler used
D. The number of keywords in the language

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. Declarative programming
B. Procedural programming
C. Assembly programming
D. Imperative programming

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

Machine and Assembly Language Medium
A. Machine language must be interpreted line by line at runtime
B. Machine language is portable across all CPU types
C. Machine language is the only form the CPU executes directly
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. Interpret source code line by line
B. Translate mnemonic instructions into machine code
C. Manage runtime memory allocation
D. Optimize high-level code into bytecode

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

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

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

Machine and Assembly Language Medium
A. Define the program's entry point only
B. Comment out a block of code
C. Mark a memory address that can be referenced
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 runs as prebuilt machine code, interpreted code is translated during execution
B. Interpreted code always runs faster than compiled code
C. Interpreted code cannot use variables
D. Compiled code needs the source each time it runs

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. Automatic conversion to assembly at install
C. Use of platform-specific header files
D. Direct compilation to each OS's machine code

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

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

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

Higher Level Languages Medium
A. Give direct access to every hardware register
B. Eliminate the need for any translation
C. Improve programmer productivity and portability
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. Linking
B. Syntax analysis (parsing)
C. Lexical analysis only
D. Code optimization

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. CSS
C. SQL
D. HTML

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. HTML
B. CSS
C. XML
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. Server-side scripting
B. Client-side scripting
C. Style casting
D. Markup rendering

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

WWW development languages Medium
A. Styling text color — HTML
B. Validating a form without reloading the page — JavaScript
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 typically executes inside the user's browser
B. It only runs on database servers
C. It cannot access page elements
D. It compiles to machine code before download

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. Testing
B. Implementation
C. Maintenance
D. Requirements analysis

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

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

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. Testing
B. Maintenance
C. Design
D. Requirements analysis

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 express repetition through recursion and set-based operations rather than explicit loop counters
B. Declarative languages always use while constructs hidden by syntax sugar
C. Declarative languages cannot process collections, so iteration is irrelevant
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. Procedural high-level, assembly, machine code, query languages
B. Machine code, assembly, procedural high-level, non-procedural query languages
C. Query languages, procedural high-level, machine code, assembly
D. Assembly, machine code, query languages, procedural high-level

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. The first pass generates object code and the second pass deletes unused labels
B. The first pass builds a symbol table of all labels, and the second pass substitutes their resolved addresses
C. It halts and reports an error because forward references are illegal
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 mnemonics map to ISA-specific opcodes and register sets that differ between processors
C. Assembly is interpreted, so timing differences cause failures
D. Assembly lacks comments, which each processor requires differently

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. Frequently executed bytecode is compiled to native machine code at runtime to improve performance
B. The source is compiled directly to native code, bypassing bytecode
C. All bytecode is translated to native code before the program starts, eliminating the VM
D. Bytecode is interpreted line by line and never converted to native code

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. Adding a numeric string to an integer produces silent implicit coercion instead of a type error
B. A file is opened but never closed, causing a resource leak
C. An infinite loop consumes all available memory
D. A null pointer is dereferenced during recursion

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. HTTPS encryption blocked the screen reader from parsing text
C. JavaScript was minified, hiding the DOM from assistive tools
D. Visual layout was achieved with non-semantic elements and CSS instead of semantic HTML structure

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. Changing the color of a button on hover
B. Reordering a list without a page reload
C. Animating a dropdown menu
D. Validating and authorizing access to protected data before returning it

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. Cross-site scripting (XSS) through injection of executable markup
B. Denial of service by exhausting CPU
C. Buffer overflow in the browser heap
D. SQL injection through the database layer

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

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. Iterative, because it forbids feedback between cycles
B. Spiral, because it ignores risk analysis
C. Agile, because it cannot handle changing requirements
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. Defects propagate through later phases, so fixing them late requires reworking design, code, and tests built on the flawed assumption
B. Maintenance engineers are paid more than analysts
C. Late defects are always in hardware rather than software
D. Requirements defects never affect code, so they are free to fix

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. Requirements gathering, before any analysis is done
B. Deployment, when the system goes live
C. System/software design, after requirements are analyzed but before coding begins
D. Testing, once the code is complete

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 is ignored until the maintenance phase
B. The project immediately moves to final deployment
C. The spiral restarts from scratch, discarding all prior work
D. Risk analysis drives the next iteration, where the identified risk is evaluated and mitigated before further engineering

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. It guarantees the total cost will be lower than any other model
B. It removes the need for testing because increments are small
C. Early increments deliver usable functionality and expose integration issues sooner, reducing late-stage surprises
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. A compiler converts the rules into sequential loops executed top to bottom
B. The interpreter ignores rules and only returns stored facts
C. An inference engine searches for variable bindings that satisfy the goal against the declared facts and rules
D. The runtime executes each fact as a function call in the order written

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. Its interpreter converts each character to assembly individually
C. Its source is first compiled to bytecode, which a virtual machine then executes
D. It is translated directly to machine code with no intermediate form