Exam Style Questions 1
Exam Style Questions 1
1. State the most suitable data type for storing the following items: (3)
a. Post code
b. Yes or No response
c. Price of an item
3. Read the code below and identify the type of error in each one and rewrite the code to show
how to fix the error: (6)
4. A program is required to take in the number of items available for sale on a garden centre
website. The minimum number is 0 and the maximum number in stock of any product is 25.
Give an example of normal, extreme and exceptional test data for this program. (3)
5. A program is required to ensure that a user can only enter a minimum car speed of 0mph
and maximum speed of 75mph. If a speed is entered below or above this speed then an
error message should be displayed. Using a design technique of your choice, design an
efficient solution to ensure that the program will only accept valid speeds from the user. (4)
6. Complete the table below. The first one has been done for you (3):
Example Construct
Total = 0.0 Assigning value to a variable
airportCode & country & airline
If population > 100000 then
New = Round(number, 2)
7. Identify the logical operators and/or arithmetic operators in the following code: (3)
END IF
END IF
a. Input (1)
b. Process (1)
c. Output (1)
d. Standard algorithm used (1)
get months
from user
PROBLEM:
Sunshine
message
“invalid”
Display
Display “valid”
message
9. Look at the code below and identify the following:
Line 2 Do
Line 6 End If
10. Rewrite the following lines of code in a more efficient way (6):
END IF
Discount = fincalCost – 25
END IF