Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Different Kinds of Code (Machine, assembly, compiled, scripting)

Total questions: 17

Worksheet time: 9mins

Name
Class
Date
1.

What is the primary difference between machine code and assembly code?

a)

Machine code is human-readable, while assembly code is not.

b)

Assembly code is a low-level language that is human-readable, while machine code is binary and executed directly by the CPU.

c)

Machine code is written in high-level languages, while assembly code is written in binary.

d)

Assembly code is faster than machine code.

2.

Which of the following is a characteristic of programming languages like C and Java?

a)

They are interpreted line-by-line at runtime.

b)

They are converted into machine code before execution.

c)

They cannot be used for system-level programming.

d)

They are always slower than scripting languages.

e)

The program is run directly all at once.

3.

What is the role of a compiler in programming?

a)

It interprets code line-by-line.

b)

It converts high-level code into machine code.

c)

It executes machine code directly.

d)

It converts machine code into assembly code.

4.

Which of the following is true about scripting languages like python & bash?

a)

They are always compiled into machine code before execution.

b)

The program is run directly all at once.

c)

Each line is run directly without needing to be compiled.

d)

They are only used for web development.

5.

How does Java differ from C in terms of execution?

a)

Java is compiled into machine code, while C is interpreted.

b)

Java is interpreted by the Java Virtual Machine (JVM) after being compiled into bytecode, while C is compiled directly into machine code.

c)

Java is faster than C because it is compiled into machine code.

d)

Java does not require a compiler, while C does.

6.

Which language is typically used for writing scripts to automate tasks in a Linux environment?

a)

C

b)

Java

c)

bash

d)

Assembly

e)

python

7.

What is the main advantage of using high-level programming languages over assembly language or even C?

a)

High-level languages are faster than assembly language.

b)

High-level languages are easier to read and write, making development faster and less error-prone.

c)

High-level languages are more secure than assembly language.

d)

High-level languages do not require a compiler.

8.

Which of the following best describes machine code?

a)

A high-level language that is easy to understand.

b)

A binary code that is directly executed by the computer's CPU.

c)

A language that requires an interpreter to run.

d)

A language used for web development.

9.

What is the purpose of an interpreter in programming?

a)

To convert machine code into high-level code.

b)

To compile high-level code into machine code and run it line by line.

c)

To compile code into machine code.

d)

To optimize machine code for faster execution.

e)

To execute high-level code line by line without converting it to machine code.

10.

Which of the following languages does NOT have to be turned into machine code to run? Select all that apply.

a)

C/Java

b)

python/bash

c)

Assembly code

d)

None of these

11.

What is a key difference between Python and Bash scripting?

a)

Python is a compiled language, while Bash is interpreted.

b)

Python is used for system administration, while Bash is not.

c)

Python is a general-purpose programming language, while Bash is primarily used for command-line scripting.

d)

Bash is faster than Python for all tasks.

12.

Which of the following is NOT a characteristic of assembly language?

a)

It is a low-level language.

b)

It is specific to a particular computer architecture.

c)

It is easy to write and understand for beginners.

d)

It provides direct control over hardware.

13.

What is the main function of the Java Virtual Machine (JVM)?

a)

To compile Java code into machine code.

b)

To interpret Java bytecode into machine code for execution.

c)

To convert Java code into assembly language.

d)

To execute Python scripts.

14.

Which of the following is a benefit of using scripting languages for automation?

a)

They are always faster than compiled languages.

b)

They allow for quick development and execution of scripts without the need to recompile entire programs.

c)

They require less memory than compiled languages.

d)

They are more secure than compiled languages.

15.

Which of the following statements is true about C programming language?

a)

C is an interpreted language.

b)

C is a high-level language that is compiled into machine code.

c)

C is only used for web development.

d)

C cannot be used for system-level programming.

16.

Order these languges from highest to lowest level.

a)

Java

b)

C

c)

Assembly code

d)

Machine code

1)
2)
3)
4)
17.

Linguists believe about half of spoken languages originated in the steppes around the Black Sea. Which of these languages did not descend from the same family as the others?

a)

English

b)

Latin

c)

Finnish

d)

Sanskrit

e)

Russian