Unit 1: Computer Languages - Practice Quiz

CSE111 — Orientation To Computing 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 Which language is directly understood by a computer's CPU?

Machine, Assembly, and High-Level Languages Easy
A. Assembly language
B. High-level language
C. Natural language
D. Machine language

2 What symbols are commonly used to write machine language instructions?

Machine, Assembly, and High-Level Languages Easy
A. Binary digits
B. English words
C. Flowchart shapes
D. Decimal fractions

3 Which language uses short symbolic codes such as ADD and MOV?

Machine, Assembly, and High-Level Languages Easy
A. Assembly language
B. Markup language
C. High-level language
D. Machine language

4 Which type of language is generally easiest for humans to read and write?

Machine, Assembly, and High-Level Languages Easy
A. Binary language
B. Machine language
C. Object language
D. High-level language

5 Which language is most closely related to the hardware of a computer?

Machine, Assembly, and High-Level Languages Easy
A. Query language
B. High-level language
C. Scripting language
D. Machine language

6 What does a compiler translate?

Compiler, Interpreter, and Assembler Easy
A. Printed documents
B. Machine code
C. High-level code
D. Computer hardware

7 What does an assembler translate into machine language?

Compiler, Interpreter, and Assembler Easy
A. Natural language
B. Database records
C. High-level language
D. Assembly language

8 How does an interpreter usually translate a program?

Compiler, Interpreter, and Assembler Easy
A. One statement at a time
B. One keyboard key at a time
C. One hardware unit at a time
D. One file name at a time

9 Which translator usually produces an object or executable program before execution?

Compiler, Interpreter, and Assembler Easy
A. Assembler
B. Compiler
C. Text editor
D. Interpreter

10 Which translator is specifically used for assembly language?

Compiler, Interpreter, and Assembler Easy
A. Assembler
B. Interpreter
C. Linker
D. Compiler

11 What is a common result when a compiler finds an error in source code?

Compiler, Interpreter, and Assembler Easy
A. An error message
B. A printed keyboard
C. A new monitor
D. A faster processor

12 What is usually the first step in developing a computer program?

Program Development Cycle Easy
A. Print the output
B. Install a monitor
C. Delete the source code
D. Analyze the problem

13 What is an algorithm?

Program Development Cycle Easy
A. A storage device
B. A computer screen
C. A step-by-step solution
D. A programming error

14 Which activity involves writing instructions in a programming language?

Program Development Cycle Easy
A. Maintenance
B. Testing
C. Documentation
D. Coding

15 What is the purpose of testing a program?

Program Development Cycle Easy
A. Find and fix errors
B. Replace the keyboard
C. Increase screen size
D. Change the power supply

16 What is debugging?

Program Development Cycle Easy
A. Creating user accounts
B. Printing program pages
C. Removing program errors
D. Designing computer hardware

17 What is source code?

Compilation and Execution Process Easy
A. Computer power settings
B. Final program output
C. Original program instructions
D. Stored user passwords

18 What is the main purpose of compilation?

Compilation and Execution Process Easy
A. Increase file font size
B. Convert code for execution
C. Create a computer network
D. Connect two printers

19 What does program execution mean?

Compilation and Execution Process Easy
A. Saving a blank file
B. Writing a program title
C. Drawing a flowchart
D. Running the program

20 Which form of code can the CPU execute directly?

Compilation and Execution Process Easy
A. Machine code
B. Pseudocode
C. Source code
D. Flowchart code

21 A machine-code program compiled for Processor X is copied to a computer using Processor Y with a different instruction set. What is most likely required?

Machine, Assembly, and High-Level Languages Medium
A. Load it directly because all machine code is standardized
B. Translate or recompile it for Processor Y's instruction set
C. Run the program after renaming its file extension
D. Use an assembler to convert the binary into source code

22 An assembly program contains the instruction ADD R1, R2. What does an assembler primarily do with this instruction?

Machine, Assembly, and High-Level Languages Medium
A. Executes it repeatedly until both registers contain zero
B. Converts it into the corresponding machine opcode and operands
C. Translates it into a hardware-independent high-level statement
D. Checks whether the program meets the user's requirements

23 A team is developing a large business application that must run on several processor types. Why is a high-level language generally preferred over assembly language?

Machine, Assembly, and High-Level Languages Medium
A. It guarantees faster execution on every processor
B. It improves portability and reduces coding effort
C. It makes source code independent of every translator
D. It exposes registers and memory addresses directly

24 A programmer needs precise control over registers and memory while writing a device driver for one processor. Which language level is most suitable?

Machine, Assembly, and High-Level Languages Medium
A. Assembly language for the target processor
B. A markup language for document structure
C. Machine-independent pseudocode only
D. A query language for database tables

25 A programming system reports several syntax errors before any part of a program begins running. Which translator behavior does this best illustrate?

Compiler, Interpreter, and Assembler Medium
A. An assembler loading data into main memory
B. A compiler analyzing the source before execution
C. An interpreter executing one statement at a time
D. A linker converting mnemonics into instructions

26 A developer wants to enter commands in an interactive console and see each result immediately. Which translator is most appropriate?

Compiler, Interpreter, and Assembler Medium
A. A loader that copies executable files into memory
B. A compiler that waits until the entire project is linked
C. An assembler that replaces labels with memory addresses
D. An interpreter that processes commands as they are entered

27 An assembly instruction branches to a symbolic label named LOOP. How does the assembler handle LOOP?

Compiler, Interpreter, and Assembler Medium
A. It asks the operating system to execute the label
B. It treats the label as input entered by the user
C. It resolves the label to an address or relative offset
D. It converts the label into a high-level loop statement

28 A source file uses processor mnemonics, symbolic labels, and directives such as .data. Which translator should process it?

Compiler, Interpreter, and Assembler Medium
A. An assembler
B. An interpreter
C. A debugger
D. A compiler

29 A program will be executed thousands of times after it is completed. Why might compilation be preferred over repeated interpretation?

Compiler, Interpreter, and Assembler Medium
A. The compiled executable can run without translating each statement again
B. The compiler automatically rewrites all inefficient algorithms
C. The compiled source becomes independent of operating system services
D. The compiler guarantees that the program contains no logical errors

30 A completed payroll program calculates overtime incorrectly because the overtime rule was misunderstood at the start of the project. Which stage should be revisited first?

Program Development Cycle Medium
A. User documentation formatting
B. Executable loading and startup
C. Program coding and translation
D. Problem analysis and requirements

31 Before writing code, a programmer creates a flowchart and discovers that one decision path never produces an output. Which stage has revealed the problem?

Program Development Cycle Medium
A. Executable loading
B. Machine translation
C. Program maintenance
D. Algorithm design

32 A test case produces an incorrect result. The programmer traces variable values, finds a faulty condition, and corrects it. Which activity is being performed?

Program Development Cycle Medium
A. Deployment
B. Documentation
C. Debugging
D. Requirement gathering

33 A tax application has worked correctly for two years, but it must now be updated to support new tax rates. Which stage does this work represent?

Program Development Cycle Medium
A. First deployment
B. Algorithm design
C. Maintenance
D. Initial analysis

34 Individual modules pass their own tests, but errors occur when the modules exchange data. Which testing activity is most appropriate next?

Program Development Cycle Medium
A. Requirements analysis
B. Integration testing
C. Source formatting
D. User training

35 A source file contains a syntax error such as a missing closing parenthesis. What is the most likely result during compilation?

Compilation and Execution Process Medium
A. Loading continues and asks the processor to repair the source
B. Execution begins and ignores the entire affected statement
C. Linking corrects the error by adding the missing character
D. Compilation reports an error and no new executable is produced

36 A source file compiles successfully, but the build reports undefined reference to calculateTotal. At which stage did the problem most likely occur?

Compilation and Execution Process Medium
A. Execution
B. Editing
C. Loading
D. Linking

37 What is the loader's main role after an executable has been created?

Compilation and Execution Process Medium
A. Convert high-level statements into assembly mnemonics
B. Place the executable in memory and prepare its process
C. Combine source comments into the final documentation
D. Check the source code against the original requirements

38 Which sequence correctly represents a typical compiled program's path from source code to execution?

Compilation and Execution Process Medium
A. Source code → linker → object code → compiler → executable → loader
B. Source code → compiler → loader → object code → linker → executable
C. Source code → loader → object code → linker → executable → compiler
D. Source code → compiler → object code → linker → executable → loader

39 A project contains three separately compiled source files. Only one source file is changed. What is normally required to create an updated executable efficiently?

Compilation and Execution Process Medium
A. Recompile the changed file and relink all required object files
B. Interpret the changed file while running the old executable
C. Reload the old executable without performing another link
D. Recompile every file and discard all unchanged object files

40 An interpreted script prints four results and then stops when it reaches an invalid statement on line 5. Why were the first four results displayed?

Compilation and Execution Process Medium
A. The loader converted the first four lines into assembly source
B. The compiler repaired the error after creating the executable
C. The linker removed the invalid line before the script started
D. Earlier statements were executed before the interpreter reached the error

41 A fixed-width ISA encodes a branch using a PC-relative displacement measured from the instruction following the branch. An entire code block, including both the branch and its target, is relocated by the same address offset. Assuming no instruction sizes change, what must happen to the encoded displacement?

Machine, Assembly, and High-Level Languages Hard
A. It becomes an absolute address supplied by the program loader
B. It remains unchanged because both relevant addresses shift equally
C. It increases by the offset applied to the relocated block
D. It decreases by the offset applied to the relocated block

42 Two processors accept assembly statements written as ADD R1, R2, but their machine encodings and operand semantics differ. What is the strongest valid conclusion?

Machine, Assembly, and High-Level Languages Hard
A. The programs are portable if both processors use fixed-width instructions
B. The identical syntax guarantees equivalent machine-level operations
C. The machine encodings differ only in their register-numbering fields
D. The mnemonic alone does not establish binary or semantic compatibility

43 A conforming high-level-language program runs on two implementations but assumes that an int has exactly 32 bits. One implementation uses 16-bit integers. Which statement best characterizes the program?

Machine, Assembly, and High-Level Languages Hard
A. Its source may compile, but its behavior is not fully portable
B. Its source is portable because both compilers accept the syntax
C. Its behavior is portable because high-level languages hide word size
D. Its machine code is portable if both systems use binary arithmetic

44 An assembler accepts LOADIMM R1, value. For small values it emits one machine instruction, while for larger values it emits three instructions. What does this demonstrate?

Machine, Assembly, and High-Level Languages Hard
A. High-level optimization is required before assembly can be processed
B. An assembly statement need not correspond to one machine instruction
C. Machine instructions are translated into assembly only during loading
D. Every assembly mnemonic must have one fixed binary representation

45 A disassembler converts an executable back into assembly instructions correctly. Which original source information is generally impossible to reconstruct uniquely from the executable alone?

Machine, Assembly, and High-Level Languages Hard
A. Constants that remain explicitly embedded in machine instructions
B. Programmer comments, macro structure, and most original symbol names
C. Control-transfer targets represented by encoded relative displacements
D. Instruction opcodes, operand fields, and encoded addressing modes

46 An assembly source contains forward references whose instruction sizes depend on the final symbol addresses. Why is a two-pass assembler commonly useful?

Compiler, Interpreter, and Assembler Hard
A. The first pass links libraries, and the second allocates virtual memory
B. The first pass executes macros, and the second debugs machine code
C. The first pass builds symbols, and the second resolves encodings
D. The first pass optimizes code, and the second interprets instructions

47 A language implementation translates source code into portable bytecode and then executes that bytecode instruction by instruction in a virtual machine. Which classification is most accurate?

Compiler, Interpreter, and Assembler Hard
A. It is purely interpreted because no native executable is produced
B. It is assembled because bytecode is equivalent to processor machine code
C. It combines compilation to bytecode with interpretation by a VM
D. It is purely compiled because the source is translated before execution

48 An optimizing compiler removes a calculation whose result is never used. Under the language's rules, the calculation has no side effects and the program has no undefined behavior. Why is the removal valid?

Compiler, Interpreter, and Assembler Hard
A. It guarantees identical execution time on every processor
B. It preserves the program's defined observable behavior
C. It causes the interpreter to recompute the value at runtime
D. It preserves the number and order of machine instructions

49 An interpreter executes statements immediately and provides no transactional rollback. Three statements update a variable successfully, but the fourth raises a runtime error. What state should normally be expected afterward?

Compiler, Interpreter, and Assembler Hard
A. All four statements are reversed because interpretation is atomic
B. The source is compiled again and all variables return to defaults
C. The earlier updates remain only if an assembler produced object code
D. The earlier updates remain, while the fourth statement is incomplete

50 An assembler encounters a call to an external function whose address is unknown but expected to be supplied by another object file. What should a relocatable-object assembler normally emit?

Compiler, Interpreter, and Assembler Hard
A. A runtime interpreter that searches the assembly source file
B. A random placeholder address treated as final machine code
C. A syntax error because every symbol must be locally defined
D. A symbol reference and relocation entry for later resolution

51 During acceptance testing, users reject a system described only as needing to respond "quickly." Which action best addresses the underlying development failure?

Program Development Cycle Hard
A. Optimize random modules until users consider the application responsive
B. Move performance decisions entirely to post-deployment maintenance
C. Replace acceptance testing with unit tests that execute more rapidly
D. Define a measurable response-time requirement and revise affected artifacts

52 Two modules pass all unit tests but fail during integration because one supplies temperatures in Celsius while the other expects Fahrenheit. What is the most appropriate corrective response?

Program Development Cycle Hard
A. Defer the mismatch until deployment reveals the preferred temperature unit
B. Increase statement coverage independently within both existing modules
C. Repeat only the original unit tests with a larger set of temperatures
D. Correct the interface contract and add tests covering unit conversion

53 A defect appears only in an optimized production build, while the unoptimized debug build passes. What is the best investigation strategy?

Program Development Cycle Hard
A. Disable optimization permanently and classify the defect as resolved
B. Rewrite the program before comparing the two build configurations
C. Preserve the reproducer and inspect undefined behavior and build differences
D. Ignore the production result because the debug build is authoritative

54 A throwaway prototype validates a user-interface concept and is then proposed for immediate production deployment. It lacks security analysis, scalability design, and automated tests. What is the best response?

Program Development Cycle Hard
A. Re-enter design and implementation using validated prototype requirements
B. Deploy it unchanged because user-interface validation covers production quality
C. Add comments to the prototype and classify it as a completed product
D. Skip design and perform acceptance testing directly in production

55 A regulatory requirement changes after release. The project maintains links among requirements, design elements, source modules, and test cases. How should these links be used first?

Program Development Cycle Hard
A. Run only existing tests because traceability replaces change analysis
B. Modify every source module because all implementation may be affected
C. Update the requirement document without revisiting derived artifacts
D. Perform impact analysis to identify artifacts requiring coordinated revision

56 In a conventional native-language toolchain that uses a preprocessor and textual assembly output, which sequence correctly orders the major stages?

Compilation and Execution Process Hard
A. Loading, preprocessing, compilation, linking, assembly
B. Compilation, preprocessing, linking, assembly, loading
C. Preprocessing, assembly, compilation, loading, linking
D. Preprocessing, compilation, assembly, linking, loading

57 A source file contains a valid declaration for compute and calls it correctly, but no linked object or library provides its definition. What outcome is most likely?

Compilation and Execution Process Hard
A. Execution begins, and the compiler creates the missing function dynamically
B. Preprocessing fails because declarations must include function bodies
C. Compilation succeeds, but linking reports an unresolved external symbol
D. Assembly fails because calls cannot reference external function names

58 A function changes from int f(int) to double f(double). The callee is rebuilt, but a caller compiled against the old declaration is not. On a platform whose linker matches only the symbol name f, what can occur?

Compilation and Execution Process Hard
A. Compilation of the rebuilt callee must also rebuild every caller automatically
B. Execution remains correct because all primitive arguments use one ABI format
C. Linking may succeed, but execution may violate the calling convention
D. Linking must detect the parameter and return-type mismatch automatically

59 A dynamically linked executable was linked successfully, but the installed shared library lacks a required symbol version. The loader is configured for eager symbol resolution. When is failure most likely?

Compilation and Execution Process Hard
A. During source preprocessing, before object files are generated
B. Only after the missing function returns a value to its caller
C. During program loading, before control reaches the program's entry point
D. During assembly, when mnemonics are converted into opcodes

60 A compiler successfully produces an object file for ISA-A, but the linker is configured to create an executable for incompatible ISA-B. The source language is supported on both systems. What is the correct conclusion?

Compilation and Execution Process Hard
A. The linker should reject the incompatible object architecture
B. The linker should translate ISA-A instructions into ISA-B instructions
C. The object remains usable because high-level source was architecture-neutral
D. The loader should reinterpret ISA-A object code as portable bytecode