Representing algorithms

EasyMediumHard
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
Question 32
Easy

An algorithm is designed to calculate how many shipping crates are needed to transport a given volume of goods. The pseudocode for this algorithm is shown below:

constant MAX_VOLUME ← 500
constant PACKING_BUFFER ← 25
OUTPUT 'Enter the total volume of goods in litres'
totalVolume ← USERINPUT
effectiveCapacity ← MAX_VOLUME - PACKING_BUFFER
cratesRequired ← 0
REPEAT
    totalVolume ← totalVolume - effectiveCapacity
    cratesRequired ← cratesRequired + 1
UNTIL totalVolume ≤ 0

Select the option that correctly identifies the input variable and the final calculated output variable representing the main result of the algorithm.

Input: cratesRequired\text{cratesRequired}cratesRequired, Output: effectiveCapacity\text{effectiveCapacity}effectiveCapacity

Input: MAX_VOLUME\text{MAX\_VOLUME}MAX_VOLUME, Output: cratesRequired\text{cratesRequired}cratesRequired

Input: totalVolume\text{totalVolume}totalVolume, Output: effectiveCapacity\text{effectiveCapacity}effectiveCapacity

Input: totalVolume\text{totalVolume}totalVolume, Output: cratesRequired\text{cratesRequired}cratesRequired

Representing algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Representing algorithms