COMPUTING FOUNDATIONS · GUIDED LESSON

From instructions to running programs

Follow data through a small program, then distinguish source code, execution and operating-system services.

Read the explanation, work through the example and answer the practice questions before taking the knowledge check.

What you will learn

  • Trace an assignment, a calculation and a decision.
  • Distinguish source code from a running process.
  • Explain the roles of language tools, libraries and the operating system.

Describe the procedure first

An algorithm is a specified procedure for a task. It needs an input format, a sequence of operations and a clear meaning for the result. A program expresses operations using a programming language.

Our task is to calculate the total cost of three items priced at four units each, then decide whether a budget of ten units covers it. Use whole-number currency units here; real payment software needs an appropriate representation of fractional amounts.

Worked example: trace the values

This is pseudocode: read it as a description, not a command to paste into a terminal.

price = 4
quantity = 3
budget = 10
total = price * quantity
if total <= budget:
    result = "within budget"
else:
    result = "over budget"
After the operationValue
Set price and quantityprice = 4, quantity = 3
Multiplytotal = 12
Compare total with budget12 <= 10 is false
Choose the else branchresult = "over budget"

An assignment changes a named value. A comparison produces a truth value used to choose a branch. If the budget changes to twelve, the same comparison becomes true.

Source code and execution

Source code is the program text a person edits. A compiler translates code into another representation. A runtime may execute intermediate instructions, compile them further or interpret them. Real language implementations often combine techniques; languages do not fall into a single universal compiled-versus-interpreted split.

A library supplies reusable code. The application still needs suitable versions, dependencies and inputs. Successfully installing a language tool does not prove that an application builds or behaves correctly.

A program becomes a process

A process is an executing instance of a program with resources managed by the operating system. Two processes can run the same program with different inputs. A process can have multiple threads of execution.

The system schedules execution and provides file, memory and network operations. A saved executable and a running process are different things. Closing a process does not normally delete its executable file.

Continue with Linux and operating-system tools. For a mathematical model of rules and execution, try the Turing worked example.

Practice and explained answers

Work out each answer before expanding it. Use the explanations and worked examples on this page.

What is the result if quantity becomes two and the budget stays ten?

The total becomes 8. Since 8 <= 10 is true, the result is within budget.

Does compiling successfully prove that the calculation is correct?

No. Compilation checks what the tool is designed to check. A program can compile and still implement the wrong calculation or fail on particular inputs.

Two people run the same editor. Are their open documents necessarily the same?

No. Separate processes can use different inputs and maintain different working state.

COMPUTING FOUNDATIONS · STEP 2 OF 13

Check what you learned

Answer both questions correctly to complete this step. You can revise your answers and retry.

1. In the worked example, price is 4, quantity is 3 and budget is 10. What does the comparison select?
2. What is a process?

Progress stays in this browser. It is not synced to an account or sent as analytics. Passing these introductory checks is not certification.

Editorial credits

Original lesson and exercises prepared for HamTron Learn. Updated 17 November 2026. This is introductory educational material, not a qualification or certification.

Return to Half Echo Learn