BREAKING
Student's code works, nobody knows why, including student★Local teen writes pseudocode, accidentally invents a language★Binary joke told in class, exactly 10 students laugh★
  1. Home
  2. A Level
  3. Computer Science
  4. OCR
  5. Inputs, processes and outputs of a problem

OCR A Level Computer Science

Topic questions Algorithms Inputs, processes and outputs of a problem

Inputs, processes and outputs of a problem

5 questions · 138 marks · about 2.5 hours

Inputs, processes and outputs of a problem questions

OCR H446 Inputs, processes and outputs of a problem 5 questions

Algorithms and programming June 2024, Question 8 13 marks

A group of students are designing a racing car game. The game will allow players to enter their name and then a choice of vehicle. They will then race against other vehicles that will be controlled by the program. Players will use the arrow keys to control their vehicle.

(a)

The students are identifying the inputs and outputs for the game.

Complete the table by identifying two inputs and two outputs for the game.

Input 1........................................................................................................................ ........................................................................................................................
Input 2........................................................................................................................ ........................................................................................................................
Output 1........................................................................................................................ ........................................................................................................................
Output 2........................................................................................................................ ........................................................................................................................
[4]
Reveal mark scheme Mark scheme for question 8(a)
(b)

The students use abstraction during the design process.

(b)(i)

State what is meant by abstraction and describe how it can be used to design the racing car game.

[3]
Reveal mark scheme Mark scheme for question 8(b)(i)
(b)(ii)

Explain why it is beneficial to use abstraction when designing a computer program such as a game.

[3]
Reveal mark scheme Mark scheme for question 8(b)(ii)
(c)
(c)(i)

The group of students also use decomposition.

State what is meant by decomposition.

[1]
Reveal mark scheme Mark scheme for question 8(c)(i)
(c)(ii)

Describe one benefit of using decomposition when designing a computer program such as a game.

[2]
Reveal mark scheme Mark scheme for question 8(c)(ii)

Algorithms and programming June 2023, Question 8 5 marks

A program is being designed that will allow a user to log into an account on a website using a username and password.

(a)

Identify two possible inputs and one output this program will need.

[3]
Reveal mark scheme Mark scheme for question 8(a)
(b)

Identify two possible sub-procedures that could be used in this program.

[2]
Reveal mark scheme Mark scheme for question 8(b)

Algorithms and programming November 2021, Question 8 40 marks

Also involves Syntax and logic errors · Arrays

Figure for question 8
(a)

Juan is creating a structure diagram to design the game.

(a)(i)
Figure for question 8
[3]
Reveal mark scheme Mark scheme for question 8(a)(i)
(a)(ii)

A structure diagram is one method of showing the decomposition of a problem.

Explain why decomposing a problem can help a developer design a solution.

[2]
Reveal mark scheme Mark scheme for question 8(a)(ii)
(a)(iii)

Identify one input, one process and one output required for the game.

[3]
Reveal mark scheme Mark scheme for question 8(a)(iii)
(b)

Juan uses the structure diagram to create a modular program with a number of subroutines. The program will use two integer 2-dimensional arrays to store the puzzles:

• puzzle(5,5) stores the solution

• answerGrid(5,5) stores the user’s current grid.

A 0 represents a white box and a 1 represents a black box.

(b)(i)
Figure for question 8
[5]
Reveal mark scheme Mark scheme for question 8(b)(i)
(b)(ii)

Explain the purpose of line 03 in the function countRow.

[2]
Reveal mark scheme Mark scheme for question 8(b)(ii)
(b)(iii)

Describe the purpose of branching and iteration in the function countRow.

[3]
Reveal mark scheme Mark scheme for question 8(b)(iii)
(b)(iv)
Figure for question 8
[6]
Reveal mark scheme Mark scheme for question 8(b)(iv)
(b)(v)

The function checkWon() takes answerGrid and puzzle as parameters and compares each element in the grids. If they are identical, it returns true, otherwise returns false.

Figure for question 8

There are three logic errors in the function checkWon.

State the line number of each error and give the corrected line.

Error 1 line number........

Error 1 correction........

Error 2 line number........

Error 2 correction........

Error 3 line number........

Error 3 correction........

[3]
Reveal mark scheme Mark scheme for question 8(b)(v)
(c)

* Juan passed the two arrays as parameters, but he did consider making them globally accessible.

Compare the use of global and local variables and data structures in this program. Include the use of parameters and program efficiency in your answer.

[9]
Reveal mark scheme Mark scheme for question 8(c)
(d)

Juan wants to create a program that will generate new Nonograms with different grid sizes. For example a Nonogram with a 10 × 10 grid or a 5 × 20 grid.

Describe how the program could be written to automatically generate a new Nonogram.

[4]
Reveal mark scheme Mark scheme for question 8(d)

Algorithms and programming June 2019, Question 7 40 marks

Figure for question 7
(a)

The programmer will use abstraction to produce the program interface to represent the garden.

(a)(i)

Give two different examples of how abstraction has been used to produce the layout of the garden.

[2]
Reveal mark scheme Mark scheme for question 7(a)(i)
(a)(ii)

Explain the need for abstraction in the production of this program.

[3]
Reveal mark scheme Mark scheme for question 7(a)(ii)
(a)(iii)

The user needs to input data into the program to set up their garden layout.

Identify three pieces of data that the user may input into this program.

[3]
Reveal mark scheme Mark scheme for question 7(a)(iii)
(b)

The program is to be built using object oriented programming.

All items that can be added to the garden are declared as instances of the class GardenItem

The class has the following attributes:

Figure for question 7
(b)(i)

The constructor method sets the attributes to values that are passed as parameters.

Write pseudocode or program code to declare the class GardenItem and its constructor. All attributes should be private and initialised through the constructor (e.g. daisies =

new GardenItem("Flowerbed",2,1) maths symbol

[4]
Reveal mark scheme Mark scheme for question 7(b)(i)
(b)(ii)

The trees in the garden layouts are defined by the class Tree. This class inherits from GardenItem.

The class Tree has the additional attributes: height, sun, shade.

If sun is true then the tree can grow in full sun, if it is false then it cannot.

If shade is true then the tree can grow in full shade, if it is false then it cannot.

The length and width of a tree are the same. Only one value for these measurements is passed to the constructor.

Write an algorithm, using pseudocode or program code, to declare the class Tree Declare all attributes as private.

[5]
Reveal mark scheme Mark scheme for question 7(b)(ii)
(b)(iii)

The Common Oak is a type of tree. It has a maximum height, length and width of 40 m. It can grow in sun and shade.

Write a statement, using pseudocode or program code, to declare an instance of tree for the Common Oak. Give the object the identifier firstTree.

[4]
Reveal mark scheme Mark scheme for question 7(b)(iii)
(b)(iv)

The classes GardenItem and Tree use get and set methods to access and alter their private attributes.

Write the get method getItemName and set method setItemName for class GardenItem. The set method takes the new value as a parameter.

Do not write any other methods, or re-declare the class.

[4]
Reveal mark scheme Mark scheme for question 7(b)(iv)
(b)(v)
Figure for question 7
[6]
Reveal mark scheme Mark scheme for question 7(b)(v)
(c)

* The programmer is designing the program to make use of caching and re-useable components.

Explain and evaluate the use of caching and re-useable components in the design of the garden program.

[9]
Reveal mark scheme Mark scheme for question 7(c)

Algorithms and programming June 2017, Question 6 40 marks

A software developer is creating a Virtual Pet game.

The user can choose the type of animal they would like as their pet, give it a name and then they are responsible for caring for that animal. The user will need to feed, play with, and educate their pet.

The aim is to keep the animal alive and happy, for example if the animal is not fed over a set period of time then the pet will die.

• The game tells the user how hungry or bored the animal is as a percentage (%) and the animal’s intelligence is ranked as a number between 0 and 150 (inclusive).

• Hunger and boredom increase by 1% with every tick of a timer.

• When the feed option is selected, hunger is reduced to 0.

• When the play option is selected, bored is reduced to 0.

• When the read option is selected, the intelligence is increased by 0.6% of its current value.

An example of the game is shown:

Figure for question 6

Fig. 1.1

(a)

Identify three inputs that the user will have to enter to start, and/or play the game.

[3]
Reveal mark scheme Mark scheme for question 6(a)
(b)

The developer is using decomposition to design the game.

(b)(i)

Describe the process of decomposition.

[2]
Reveal mark scheme Mark scheme for question 6(b)(i)
(b)(ii)
Figure for question 6
[6]
Reveal mark scheme Mark scheme for question 6(b)(ii)
(c)

The developer needs to write procedures for the options play and read. Each of the options changes its corresponding value, and outputs the results to the screen.

(c)(i)

Write a procedure, using pseudocode, to reset bored and output the new value in an appropriate message.

[3]
Reveal mark scheme Mark scheme for question 6(c)(i)
(c)(ii)

Write a procedure, using pseudocode, to increase intelligence by 0.6% and output the new intelligence in an appropriate message.

[3]
Reveal mark scheme Mark scheme for question 6(c)(ii)
(d)

The developer is extending the game to allow users to have multiple pets of different types. The developer has written a class, Pet.

The attributes and methods in the class are described in the table:

Figure for question 6

Part of the class declaration is given:

Figure for question 6
(d)(i)
Figure for question 6
[4]
Reveal mark scheme Mark scheme for question 6(d)(i)
(d)(ii)

Write a line of code that creates a new instance of Pet for a Tiger called “Springy”.

[2]
Reveal mark scheme Mark scheme for question 6(d)(ii)
(d)(iii)

The method outputGreeting for the superclass is written as follows:

Figure for question 6

A class is needed for Tiger. The class needs to:

• inherit the methods and attributes from pet

• in the constructor, set type to Tiger, intelligence to 10, hunger to 50 and bored to 10

• extend the method outputGreeting, by outputting an additional line that says “I like to eat meat and roar”

Write, using pseudocode, the class Tiger.

[5]
Reveal mark scheme Mark scheme for question 6(d)(iii)
(e)

(e*) The developer made use of abstraction when creating the Virtual Pet game.

Discuss the need for and purpose of abstraction and how abstraction will be used in the

development of the game.

[9]
Reveal mark scheme Mark scheme for question 6(e)
(f)

The developer is storing the user’s pets in a 1-dimensional array. At each timer interval, the array is searched, using a linear search, to check if any pets’ hunger or bored values are greater than 90%. If they are, an alert is displayed to the user.

(f)(i)

State the complexity of searching the pets in Big-O notation.

[1]
Reveal mark scheme Mark scheme for question 6(f)(i)
(f)(ii)

A given computer takes 4 milliseconds (ms) to search an array of 20 pets. Calculate an estimate of how long the computer will take to search an array of 100 pets.

Show your working.

[2]
Reveal mark scheme Mark scheme for question 6(f)(ii)

Report a problem with a question on this page
What is wrong?

Goes to whoever maintains the question split. No account needed and nothing is published on this page.

Memes

Certified Computer Science memes. Peer-reviewed by nobody.

Laugh now. Cry in the exam hall later. Then come back and do a past paper.

Write a proper algorithm
Write ‘sort it’ and leave
Me on the 6-mark pseudocode question
Debugging with print statements
Using a trace table
Knowing the difference between = and ==
Explaining recursion by explaining recursion
Code enlightenment, ranked

Mum 💖

can you fix the wifi since you do computers 🥰

that's not what computer science is

so that's a no then

📱 Screen time this week · Discord8h 2m

Turned it off and on again

Computer Science starter pack

Laptop with 47 tabs openPython error on line 1Counting binary on fingersThis website
Compiled with zero errors