OCR High School uses a computer system to store data about students' conduct - OCR - GCSE Computer Science - Question 1 - 2018 - Paper 1
Question 1
OCR High School uses a computer system to store data about students' conduct. The system records good conduct as a positive number and poor conduct as a negative num... show full transcript
Worked Solution & Example Answer:OCR High School uses a computer system to store data about students' conduct - OCR - GCSE Computer Science - Question 1 - 2018 - Paper 1
Step 1
State the most appropriate data type used to store each of the following items of data.
* StudentName
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The most appropriate data type for StudentName is a String, as it is used to store textual information.
Step 2
* Points
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The most appropriate data type for Points is Integer or Real, as it needs to store numeric values which can be positive or negative.
Step 3
* LetterSent
96%
101 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The most appropriate data type for LetterSent is Boolean, as it only needs to represent two states: TRUE (sent) or FALSE (not sent).
Step 4
The data shown above in Fig. 1 is stored in a database table called Conduct.
98%
120 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
To store the data shown, the SQL query can read from the database as follows:
SELECT StudentName
FROM Conduct
WHERE Points < 0;
Step 5
Write an algorithm that will identify whether the data in the studentdata array shows that a letter has been sent home or not for the student.
97%
117 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Here is a simple algorithm to determine if the letter was sent:
if studentdata[3] == "TRUE" then
print "sent"
else
print "not sent"