Question 10
OCR Computer Science June 2017 Paper 1A level22 marks
On the specification
- (a)
- 1.2 Software and software development
- (b)
- 2.2 Problem solving and programming
- (c)
- 1.4 Data types, data structures and algorithms
- (d)(i)
- 1.2 Software and software development
- (d)(ii)
- 1.2 Software and software development
Question text
10 A software development team is writing a word game. The team is using Rapid Application Development. (a) Describe the Rapid Application Development process. [4] Players are given 10 random letters and asked to find the largest word they can make from those letters. Each letter can only be used once. The length of the word determines the number of points awarded. e.g. a word with 6 letters would mean 6 points are awarded. The function validateAnswer takes in the randomLetters as an array of letters and the player’s answer as a string. It then checks if the word the player has entered only contains letters from the 10 random letters with each letter being used only once. (At this stage the program doesn’t check if the answer provided is an actual word.) It then returns a score, out of 10, for a valid word or 0 for an invalid word. Example If the random letters are OPXCMURETN The word COMPUTER returns 8 Whereas The word POST returns 0 (there is no S in the random letters). And The word RETURN returns 0 (there is only one R in the random letters). (b) Complete the function validateAnswer function validateAnswer(answer, randomLetters[]) endFunction [6] (c) Code is to be added to check if the word is an actual English word. All English words are stored in a binary search tree. Give one advantage of storing the words in a binary search tree over an array. [1] (d) The software team use a prebuilt library to create the Graphical User Interface. (i) Give two advantages to the software team of using a library. 1 2 [2] (ii)* The program is compiled. Explain the process of compilation including how code from the library becomes part of the finished program, justifying why each stage is necessary. [9]