KEMBAR78
2210 - 02 - Status Basic - Program Design 2024 | PDF | Computer Programming | Computing
0% found this document useful (0 votes)
54 views6 pages

2210 - 02 - Status Basic - Program Design 2024

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)
54 views6 pages

2210 - 02 - Status Basic - Program Design 2024

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/ 6

2

Status Basic: Program Design Logic

Name: Date: Marks: /75

1. (a) Tick (✓) one box to show the example of a Boolean operator:

Paper | 1
A. + [ ] B. DIV [ ] C. >= [ ] D. NOT [ ] [1]
(b) Each pseudocode statement for the table contains an example of selection, assignment or iteration.
Put one tick (‘✓’) in the appropriate column for each statement.
Statement Selection Assignment Iteration
Index  Index + 1
IF Modified = TRUE THEN
ENDWHILE
[3]
(c) Give one action that a program needs to take to store data in a file.
………………………………………………...………………….…….………...…………....[1]
(d) (i) High light the Condtion-Controlled constructs in the following code.
Index = 5
WHILE Index < 20 DO
OUTPUT (Index MOD 5 )
Index = Index + 5
ENDWHILE [2]
(ii) Explain what is meant by iteration construct.

………………………..……………...……………….………...……………………….……….
……………………………..……………..……………………..……………..………………[1]
(iii) Give the numbers that will be printed by this algorithm.
………………………………………………...………………….…….………...…………....[2]
2. (a) Describe, giving an example for each, the following data types used in programming.
Draw a line to link each pseudocode description to the most appropriate pseudocode.
Pseudocode description Pseudocode statement
FOR…TO…NEXT
a loop that will always iterate at least once
IF…THEN…ELSE…ENDIF
a conditional statement to deal with many possible outcomes
WHILE…DO…ENDWHILE
a loop that will always iterate a set number of times
CASE…OF……ENDCASE
a conditional statement different outcomes for true and false
REPEAT…UNTIL
[4]
(b) Using a single loop, write a pseudocode to output 50 player that have been stored in the array, PName[]
…………………..……………...……...………………...……………………….………...…….
…………………..……………...……...………………...……………………….………...…….
…………………..……………...………...…………………..…………………….……..….…..
………………………..……………...……………….………...……………………….……….
……………………………..……………..……………………..……………..………………[3]

© HSCICT 2023 2210 / 22 / Status Basic 01/ Summer 2024


3
3. (a) Draw a flowchart for an algorithm to:
o allow numbers to be input
o count how many numbers are in between 1-50
o output the count of positive numbers when -1 is input and end the algorithm.
…………………..……………...……...………………...……………………….………...…….
…………………..……………...……...………………...……………………….………...…….

Paper | 1
…………………..……………...……...………………...……………………….………...…….
…………………..……………...……...………………...……………………….………...…….
…………………..……………...……...………………...……………………….………...…….
…………………..……………...……...………………...……………………….………...…….
…………………..……………...………...…………………..…………………….……..….…..
………………………..……………...……………….………...……………………….……….
…………………..……………...……...………………...……………………….………...…….
…………………..……………...……...………………...……………………….………...…….
…………………..……………...……...………………...……………………….………...…….
…………………..……………...………...…………………..…………………….……..….…..
………………………..……………...……………….………...……………………….……….
……………………………..……………..……………………..……………..………………[6]
(b) Explain the changes you will make to your algorithm to also count the 0-100 numbers.
…………………..……………...…………...………………..…………………….……..….…..
………………………..……………...……………….………....……………………….……….
……………………………..……………..…………………………..………..………………[3]

4. Explain why constants, variables and arrays are used in programming.


(a) (i) Constants ………...……………...……………………….....…………………….……….…….
……………………………..……………..………………..…………………..………………[1]
(ii) Variable………...……………...……………..…………….…………………….……….…….
……………………………..……………..……………..……………………..………………[1]
(iii) Array………...…………….....………………………………………………….……….…….
……………………………..……………..…………………..………………..………………[1]
(b) Tick (✓) one box to select statements describes the coding stage of the program development lifecycle?
[ ] Investigating to provide the specification of what a program is required to do.
[ ] Testing of the program to make sure that it works under all conditions
[ ] Writing of the program or suite of programs
[ ] Using the program specification to show to how the program should be developed [1]

(c) Tick (✓) one box to name the program development lifecycle stage the computer term describe below:
“is the process of removing unnecessary detail from a problem so that the important details can be focused on”
A. Algorithm [ ] B. Analysis [ ] C. Design [ ] D. Coding [ ] [1]

© HSCICT 2023 2210 / 22 / Status Basic 01/ Summer 2024


4
5 Read the follow chart for a program
Start

A=0, B=0

INPUT N

Paper | 1
Yes Yes
N =0 ? W=B/A

No
OUTPUT W
B=B+N

End
A = A+ 1

(a) Describe the purpose of the flowchart is doing.


……………………………...…………………...……………………………..………..…....…
…………………………...…………………...……………………………..…………..…....[1]
(b) Complete the trace table for the algorithm using this data:
20, 30, -10, 20, 0, -9, 27, 30.5
A B N W Output

[4]
(c) Suggest meaningful names for:
A ……………………………...……………W…….....……………………………..……….. [2]

6. (a) Four validation checks and four descriptions are shown.


Draw a line to connect each validation check to the correct description.
Validation Check Description
Range Check Checks that some data is entered.

Presence Check Checks for a maximum number of characters in the data entered.

Length Check Checks that the characters entered are all numbers.

Type Check Checks that the value entered is between an upper value and a lower value
[4]
(b) A function is declared using pseudocode.
01 FUNCTION ConvertDollar(Taka:INTEGER) RETURNS --------
02 RETURN Taka * 109.5
03 ENDFUNCTION
Tick (✓) one box which accurately completes the use of the Function Definition Line 01

A. Call [ ] B. REAL [ ] C. Parameter [ ] D. Answer [ ] [1]

© HSCICT 2023 2210 / 22 / Status Basic 01/ Summer 2024


5
7. A database table, PAYMENT, is used to keep a record of the payment at a local school.
Type Cash Amount
Tuition No 4000
Mock No 6000
Lab Yes 8000
Tuition No 3500
Lab Yes 8000

Paper | 1
Lab Yes 6000
(a) Explain why none of the fields in the database can be used as a primary key.
…………………………..……….……..…………………………………..……………..……[1]
(b) State, with a reason, field that could be added as a primary key with example of some sample data that field.
………………………..……………...……………….………...………………...………….……
…………………………..……………..…………………………………..……...……………[1]
(c) SELECT *
FROM PAYMENT
WHERE Cash = 'Yes'
ORDER BY Amount;
Show the output from this SQL command.
Type Cash Amount

[3]
8. (a) Read the pseudocode that inputs fifty (50) numbers and stores them in an array
StoredNumber[1:50].
Only numbers between 0 and 100 can be stored, all others are rejected.
01 For Index = 0 TO 100
02 REPEAT
03 INPUT Number
04 WHILE Number >= 0 OR Number <= 50
05 StoredNumber[Index] ← Number
06 Index ← Index + 1
07 NEXT Number
There are six errors in this code, some lines have more than one error.
Locate these errors and suggest a corrected piece of code for each error.
1…………………..……………...……..…………………..………..……………….………..…
…………………..……………...…………………………………………………….………...…
2…………………..……………...…………………………..……………….………….……..…
………………………..……………...……………….………...………..………………….……
3…………………..……………...……..…………………..………………...……….………..…
…………………..……………...……………………………………………….……………...…
4…………………..……………...…………………………..………………………….……..…
………………………..……………...……………….………...………………………..….……
5…………………..……………...……..…………………..…………………….………..…..…
…………………..……………...……………………………………………….……………...…
6…………………..……………...…………………………..………………………….……..….
……………………………..…………..…………………………………..……………..……[6]
© HSCICT 2023 2210 / 22 / Status Basic 01/ Summer 2024
6
9. Consider the truth table:
A B C X
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0

Paper | 1
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
(a) Draw a logic circuit to represent the given truth table.
Each logic gate should have maximum of two inputs.
Do not simplify the logic circuit.

C X

B
[5]
(b) Write a logic expression for the given truth table.
Do not simplify the logic expression.
………………………..……………...……………….………...……………….……….….…….
……………………………..……………..…………………………………..……..…….……[2]
10 These methods are used to design a solution to a problem:
o structure diagram
o flowchart
o pseudocode
Problem: finding the cost to get enroll in Space Program.
The ParticipantNo is input and if it is less than 20 or greater than 100, the participant is rejected.
ParticipantNo less than 25 are small, ParticipantNo between 25 and 50 are medium and ParticipantNo over
50 are large group.
Small ParticipantNo cost $15.00 to enroll for each , medium ParticipantNo cost $12.00 to enroll and large
ParticipantNo cost $10.00 to enroll.
Construct a solution to this problem using each method.
(a) Structure chart
…………………..……………....………………………..…………………….……….……..….
…………………..……………....………………………..…………………….……….……..….
…………………..……………....………….………………………………….……….……...….
…………………..………….…...………………………..…………………….…………...…….
…………………..……………...………….………………………………….……….……...….
………………………..……………...……………………...……………………….……..…….
……………………………..……………..………….……………………..………………..…[3]
© HSCICT 2023 2210 / 22 / Status Basic 01/ Summer 2024
7
(b) Flowchart
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….

Paper | 1
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
……………………………..……...…………..………………………………..………………[6]

(c) Pseudocode
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
…………………..……………...………………………..…………………….………...….…….
……………………………..……………..………………………...…………..………………[6]

© HSCICT 2023 2210 / 22 / Status Basic 01/ Summer 2024

You might also like