0% found this document useful (0 votes)
13 views3 pages

UA03 - Data Types and Records

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views3 pages

UA03 - Data Types and Records

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

2

Unit 03: Data Types and Records Design

Name: Date: Marks: /35

1. The following pseudocode is to define to take two numbers as input and outputs the largest.

Paper | 2
DECLARE FIRST, SECOND : INTEGER
INPUT FIRST, SECOND
IF FIRST > SECOND THEN
OUTPUT FIRST
ELSE
OUTPUT SECOND
ENDIF
The algorithm needs to be amended to include the following changes:
1. Input three values(THIRD), ensuring that each value input is unique.
2. Output the average.
3. Output the largest value.
Write the pseudocode for the amended algorithm.
…………………..……………...………….………………………………….……….…….
…………………..……………...………………………..…………………….……….…….
…………………..……………...………….………………………………….……….…….
…………………..……………...………………………..…………………….……….…….
…………………..……………...………….………………………………….……….…….
…………………..……………...………….………………………………….……….…….
…………………..……………...………………………..…………………….……….…….
………………………..……………...……………………...……………………….……….
……………………………..……………..………………………………..………………[6]
2. A company keeps details of its space program items in a 1D array, Space.
The array consists of 120 elements of type ProgramList.The record fields of are ProgramList:
Filed Typical Value
ProgramCode "HSC-12-A"
Cost 100.50
NumberOfDays 5
(a) Write pseudocode to declare the record structure ProgramList.
…………………..……………...………….………………………………….……….…….
…………………..……………...………………………..…………………….……….…….
………………………..……………...……………………...……………………….……….
……………………………..……………..………………………………..………………[3]
(a) Write pseudocode to declare the Space array.
………………………..……………...……………………...……………………….……….
……………………………..……………..………………………………..………………[3]
(c) Write pseudocode to modify the values to element 10 as follows for Program Code “HSC-22-E:
• set the cost to 105.75 • increase the NumberOfDays by 12
………………………..……………...……………………...……………………….……….
……………………………..……………..………………………………..………………[2]

© HEGICT 2024 9618/ P2 / Unit Assessment 03 / Summer 2024


3
3. Show what type of programming construct each statement represents.
(a) Complete the table by putting a tick (✓) in the appropriate column for each item.
Item Statement Selection Iteration Assignment
1 MyScore = 65
2 FOR IndexVal = 0 TO 99
3 MyArray[3] = MID(MyString,3,2)
4 IF MyScore >= 70 THEN

Paper | 2
5 ENDWHILE
6 ELSE Message = "Error"
[6]
(b) State the purpose of each statement in the table in part (a).Do not use mathematical symbols.

Item Purpose of statement


1
2
3
4
5
6
[6]
4. Tahsina downloads music from an online music store.
The diagram shows part of a structure chart for the online music store program.

(a) State three items of information that the diagram shows about the design of the program.
1….……………..……………...………………………..…………………….……….…….
2………………..……………...………….………………………...………….……….…….
3…………………..…..……………...……………………...……………………….……[3]
(b) Examples of the data items that correspond to the arrows are given in the table.
Arrow Data item
A 234.56
B "Ms Tahsina Ahmed"
C TRUE
Use pseudocode to write the function header for the Card payment module.
…………………..……………...………………………..…………………….……….…….
………………………..……………...……………………...……………………….……….
……………………………..……………..………………………………..………………[3]
(c) A problem may be decomposed into sub-tasks when designing an algorithm.
Give three benefits of using sub-tasks.
…………………..……………...………….………………………………….……….…….
…………………..……………...………………………..…………………….……….…….
………………………..……………...……………………...……………………….……….
……………………………..……………..………………………………..………………[3]

© HEGICT 2024 9618/ P2 / Unit Assessment 03 / Summer 2024


4

Paper | 2

© HEGICT 2024 9618/ P2 / Unit Assessment 03 / Summer 2024

You might also like