A program creates usernames for a school - OCR - GCSE Computer Science - Question 4 - 2023 - Paper 1
Question 4
A program creates usernames for a school. The first design of the program is shown in the flowchart in Fig. 2:
For example, using the process in Fig. 2, Tom Ward's ... show full transcript
Worked Solution & Example Answer:A program creates usernames for a school - OCR - GCSE Computer Science - Question 4 - 2023 - Paper 1
Step 1
State, using the process in Fig. 2, the username for Rebecca Ellis.
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
To create the username for Rebecca Ellis using the process in Fig. 2:
First, take the first three letters of the first name 'Rebecca', which gives 'Reb'.
Next, take the first two letters of the surname 'Ellis', which provides 'El'.
Combine these two parts to create the username: 'RebEl'. Thus, the username for Rebecca Ellis is RebEl.
Step 2
What would be the username for a teacher called Fred Biscuit using the updated process?
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
For the teacher 'Fred Biscuit', we use the updated username creation process:
Take the last three letters of the surname 'Biscuit', which gives 'uit'.
Then, take the first two letters of the first name 'Fred', which gives 'Fr'.
Combine these parts to arrive at the username: 'uitFr'. Hence, the username for Fred Biscuit is uitFr.
Step 3
Write an algorithm for the updated program design shown in question 4(b)(i).
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
Algorithm for creating the username for a teacher:
Start
Input teacher's first name (Fred)
Input teacher's surname (Biscuit)
Set username = last three letters of surname + first two letters of first name