Representing algorithms

EasyMediumHard
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
Question 40
Easy

Select one option to show which of the following best represents the input and the final calculated output variable representing the result of the algorithm in Figure 1.

Figure 1

constant BLOCK_SIZE ← 4096
constant METADATA_SIZE ← 128
OUTPUT 'Enter the size of the file in bytes'
fileSize ← USERINPUT\nusableSpace ← BLOCK_SIZE - METADATA_SIZE
blocksNeeded ← 0
REPEAT
    fileSize ← fileSize - usableSpace
    blocksNeeded ← blocksNeeded + 1
UNTIL fileSize ≤ 0

Input: blocksNeeded, Output: usableSpace

Input: fileSize, Output: blocksNeeded

Input: usableSpace, Output: fileSize

Input: BLOCK_SIZE, Output: blocksNeeded

Representing algorithms Questions

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