54 T

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Q1.

A) Large ← 0

Small ← 1000

REPEAT

FOR Count ← 1 TO 500

OUTPUT "Enter a whole number between 1 and 999"

INPUT Number

UNTIL Number >= 1 AND Number < 1000 AND Number = Number DIV 1

IF Number < Small

THEN

Small ← Number

ENDIF

IF Number > Large

THEN

Large ← Number

Range ← Large – Small

NEXT

OUTPUT "Largest number is ", Large " Smallest number is ", Small" Range of numbers is ", Range

ENDIF

b)

Q2. A)

Y Z A OUTPUT
11 4 3 Invalid
6 2 0 Valid
3 9 0 Valid
3 2 1 Invalid
2 6 0 Valid
0 0
1 1 0 Valid

b) The purpose is to divide the two numbers inputted by the user and then divide the bigger no. by
the smaller number. The Numbers will only be valid if the remainder is 0.

Q3. A) Check 1 – Presence Check

Purpose – Checks if anything has been inputted by the user

Check 2 – Length Check


Purpose – Checking if inputted data is a specific length. E.g: password must be atleast 8 digits long

B) Double entry check

c) Validation can only check that the data entered 


is reasonable
Verification is used to double-check that the data has been typed in correctly .

You might also like