Question Detail

COS 102 2 lecture week 3 Objective Question

Question

Which statement best describes how programming languages work, according to the information provided?
Options
A All programming languages have identical syntax and execute directly on computer hardware.
B Languages vary in syntax (e.g., Python vs. BASIC) and most need translation to machine code before execution.
Correct Answer
C All programming languages are written in uppercase and are directly understood by computers without translation.
D Programming languages are exclusively used for mathematical calculations and nothing else.
Correct Answer

Option B is the correct answer.

Detailed Explanation

Slide 18 states: 'Different languages work in different ways. For example, in Python all instructions are written in lowercase, but in BASIC they tend to be written in uppercase.' It also says: 'Most programming languages must be translated into machine code before the computer can execute the instructions.'

Hint

Consider the diversity of programming languages and the necessity of a specific step before the computer can run the code.

Question Info