A program displays a progress bar to inform the user of the progress of tasks that take a significant time to complete, such as those involving file transfer operations. Task progress is divided into 11 steps. Each step represents the amount of progress as a percentage. An image is associated with each step and each image is stored in a different file. Different progress bar images may be selected. For a given image, files all have the same filename root, with a different suffix. The table illustrates the process for using the image with filename root BargraphA Step | Percentage progress | Image filename | Image ---|---|---|--- 1 | < 10 | BargraphA-1.bmp | 2 | >= 10 and < 20 | BargraphA-2.bmp | 3 | >= 20 and < 30 | BargraphA-3.bmp | ... | ... | ... | ... 9 | >= 80 and < 90 | BargraphA-9.bmp | 10 | >= 90 and < 100 | BargraphA-10.bmp | 11 | 100 | BargraphA-11.bmp | A procedure Progress() will: • be called with two parameters: ο an integer representing the percentage progress (0 to 100 inclusive) ο a string representing the image filename root • generate the full image filename • call a procedure Display() using the full image filename as the parameter.
- (a)Write pseudocode for procedure Progress().[6]
- (b)(i)Write pseudocode for the new module header.[2]
- (b)(ii)State one benefit of increasing the number of steps.[1]
Mark scheme
Marking points from the official mark scheme (May/June 2024). The mark or mark type is shown in brackets.
- [1] (a) Procedure heading, parameters and ending
- [1] (a) Calculate StepValue as integer value // Attempt at calculating file number
- [1] (a) Add 1 to obtain file number // Completely correct file number calculation
- [1] (a) Use of NUM_TO_STR() to convert file number to string and use
- [1] (a) Concatenate Root, hyphen, file number and ".bmp" suffix
- [1] (a) Call Display() with filename as parameter following a reasonable attempt
- [1] (a) (Alternative for selection solution) Correct selection construct(s) structure
- [1] (a) (Alternative for selection solution) Use of selection statement to obtain two file numbers
- [1] (a) (Alternative for selection solution) Use of selection statement to obtain all the file numbers
- [1] (b)(i) Keyword FUNCTION Progress2 and three parameters of correct type
- [1] (b)(i) Keyword RETURNS and type string
- [1] (b)(ii) The progress display will more accurately show the progress of the task
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →