OCR H446 A-Level Computer Science

Similar documents
OCR H446 A-Level Computer Science

OCR H446 A-Level Computer Science

OCR H446 A-Level Computer Science

OCR Level 3 Advanced GCE in Computer Science (H446)

OCR J276 GCSE Computer Science

OCR H446 A-Level Computer Science

OCR H446 A-Level Computer Science

Computer Science Curriculum Content, KS5

SAMPLE CURRICULUM GUIDE June 2014

OCR J276 GCSE Computer Science

F453 Module 7: Programming Techniques. 7.2: Methods for defining syntax

Monday 9 June 2014 Afternoon

Department Curriculum and Assessment Outline

Teddington School Sixth Form

OCR J276 GCSE Computer Science

Personalised Learning Checklist ( ) SOUND

INSTRUCTIONS TO CANDIDATES INFORMATION FOR CANDIDATES. Computer Science (A Level)

Lecture Chapter 6 Recursion as a Problem Solving Technique

Learning objectives. Computer principles The characteristics of contemporary processors, input, output and storage devices

Introduction. Problem Solving on Computer. Data Structures (collection of data and relationships) Algorithms

Elizabethtown Area School District

PARENTS AND STUDENTS Check out our computing qualifications for Key Stage 4

Year 12 Computer Science Learning Cycle 2 Overview

Computer Science. AS/A Level H046/H446

CS 206 Introduction to Computer Science II

Stack Applications. Lecture 25 Sections Robb T. Koether. Hampden-Sydney College. Mon, Mar 30, 2015

Table of Contents. Chapter 1: Introduction to Data Structures... 1

CSE 373 APRIL 17 TH TREE BALANCE AND AVL

Backtracking. The Eight Queens Problem. The Eight Queens Problem. The Eight Queens Problem. The Eight Queens Problem. Chapter 5

OCR H446 A-Level Computer Science

CS W3134: Data Structures in Java

Practical Exam. Recursion and Friends

Developing Algorithms

CS 314 Exam 2 Spring

Recursion Solution. Counting Things. Searching an Array. Organizing Data. Backtracking. Defining Languages

STACKS. A stack is defined in terms of its behavior. The common operations associated with a stack are as follows:

Computing. Curriculum booklet. enquiries:

Backtracking. See Section 7.7 p of Weiss

Recursion as a Problem-Solving Technique. Chapter 5

Cambridge International Examinations Cambridge International Advanced Subsidiary and Advanced Level

CS 171: Introduction to Computer Science II. Stacks. Li Xiong

Backtracking. Module 6. The Eight Queens Problem. CS 147 Sam Houston State University Dr. McGuire. Backtracking. Recursion Revisited

DEEPIKA KAMBOJ UNIT 2. What is Stack?

Prefix/Infix/Postfix Notation

2D Array Practice. Lecture 26

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Autumn 1 Autumn 2. An Introduction to Idsall s Network & esafety. Programming with Scratch. Spring 1 Spring 2

Abstract Data Structures IB Computer Science. Content developed by Dartford Grammar School Computer Science Department

2c. Content of Computer systems (Component 01)

CS510 \ Lecture Ariel Stolerman

Stacks Fall 2018 Margaret Reid-Miller

09 STACK APPLICATION DATA STRUCTURES AND ALGORITHMS REVERSE POLISH NOTATION

March 13/2003 Jayakanth Srinivasan,

OCR GCSE Computing Learning Grids H/W

Some Applications of Stack. Spring Semester 2007 Programming and Data Structure 1

OCR J276 GCSE Computer Science

S.E. (Computer) (First Semester) EXAMINATION, 2011 DATA STRUCTURES AND ALGORITHM (2008 PATTERN) Time : Three Hours Maximum Marks : 100

Outline. Stacks. 1 Chapter 5: Stacks and Queues. favicon. CSI33 Data Structures

FORTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLIGY- MARCH, 2012 DATA STRUCTURE (Common to CT and IF) [Time: 3 hours

OCR J276 (9-1) GCSE Computer Science

D - Tic Tac Toe. Let's use our 9 sparkles to build a tic tac toe game! 2017 courses.techcamp.org.uk/ Page 1 of 9

Introduction p. 1 Pseudocode p. 2 Algorithm Header p. 2 Purpose, Conditions, and Return p. 3 Statement Numbers p. 4 Variables p. 4 Algorithm Analysis

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

Friday, March 30. Last time we were talking about traversal of a rooted ordered tree, having defined preorder traversal. We will continue from there.

Alpha-Beta Pruning in Mini-Max Algorithm An Optimized Approach for a Connect-4 Game

ICT & Computing Progress Grid

CMSC132, Practice Questions

DATA MINING II - 1DL460

AP Computer Science AB

CS 445: Data Structures Final Examination: Study Guide

Formal Languages and Automata Theory, SS Project (due Week 14)

Solving Problems by Searching

Technical University of Denmark

12 Abstract Data Types

CHAOS Chaos Chaos Iterate

Parallel Programming. Parallel algorithms Combinatorial Search

Graph and A* Analysis

Lecture 3, Review of Algorithms. What is Algorithm?

Computer Science First Exams Pseudocode Standard Data Structures Examples of Pseudocode

Space Filling Curves and Hierarchical Basis. Klaus Speer

STUDY GUIDE. Illinois Licensure Testing System. Computer Science (038) This test is now delivered as a computer-based test.

Program of Study. Artificial Intelligence 1. Shane Torbert TJHSST

Basic Search. Fall Xin Yao. Artificial Intelligence: Basic Search

CS 206 Introduction to Computer Science II

UCS-406 (Data Structure) Lab Assignment-1 (2 weeks)

Data Structures. 1. Each entry in a linked list is a called a (a)link (b)node (c)data structure (d)none of the above

CS61B Lecture #35. [The Lecture #32 notes covered lectures #33 and #34.] Today: Enumerated types, backtracking searches, game trees.

Search and Optimization

AP Statistics Summer Review Packet

AP Statistics Summer Math Packet

IT 4043 Data Structures and Algorithms. Budditha Hettige Department of Computer Science

STAGE 3. KSPS Stage 3 Math Scope and Sequence. Overview. Assessment

Computer Science 210 Data Structures Siena College Fall Topic Notes: Trees

CMPSCI 250: Introduction to Computation. Lecture #24: General Search, DFS, and BFS David Mix Barrington 24 March 2014

Lab 7 1 Due Thu., 6 Apr. 2017

Millburn Academy. Numeracy Across Learning. Name. Department

GAUTENG DEPARTMENT OF EDUCATION SENIOR SECONDARY INTERVENTION PROGRAMME. MATHEMATICS Grade 11 SESSION 17 LEARNER NOTES

STRUCTURES AND STRATEGIES FOR STATE SPACE SEARCH

Stack Applications. Lecture 27 Sections Robb T. Koether. Hampden-Sydney College. Wed, Mar 29, 2017

Appendix A: Objectives and Courseware Locations

Transcription:

Name: Class Teacher: Date: OCR H446 A-Level Computer Science REVISION BOOKLET 2.2 PROBLEM SOLVING AND PROGRAMMING Content in H446 A-Level Computer Science: 1.1 The characteristics of contemporary processors, input, output and storage devices 1.2 Software and software development 1.3 Exchanging data 1.4 Data types, data structures and algorithms 1.5 Legal, moral, cultural and ethical issues 2.1 Elements of computational thinking 2.2 Problem solving and programming 2.3 Algorithms www.learn-computerscience.com

2.2.1 PROGRAMMING TECHNIQUES TOPIC Programming constructs: Sequence Iteration Branching Recursion, how it can be used and compares to an iterative approach Global and local variables Modularity, functions and procedures, parameter passing by value and by reference Use of an IDE to develop/debug a program Use of object-oriented techniques

PROGRAMMING CONSTRUCTS SEQUENCE 2.2.1 PROGRAMMING TECHNIQUES ITERATION BRANCHING HOW RECURSION CAN BE USED AND COMPARES TO AN ITERATIVE APPROACH GLOBAL AND LOCAL VARIABLES MODULARITY FUNCTIONS AND PROCEDURES

PARAMETERS PASSING BY VALUE AND BY REFERENCE USE OF AN IDE TO DEVELOP/DEBUG A PROGRAM USE OF OBJECT-ORIENTED TECHNIQUES

2.2.2 COMPUTATIONAL METHODS TOPIC Features that make a problem solvable by computational methods Problem recognition Problem decomposition Use of divide and conquer Use of abstraction Learners should apply their knowledge of: Backtracking Data mining Heuristics Performance modelling Pipelining Visualisation to solve problems

2.2.2 COMPUTATIONAL METHODS FEATURES THAT MAKE A PROBLEM SOLVABLE BY COMPUTATIONAL METHODS PROBLEM RECOGNITION PROBLEM DECOMPOSITION USE OF DIVIDE AND CONQUER USE OF ABSTRACTION BACKTRACKING DATA MINING

HEURISTICS PERFORMANCE MODELLING PIPELINING VISUALISATION TO SOLVE PROBLEMS

EXAM QUESTIONS QUESTION 1 A systems analyst has been employed by a busy city library to produce a new computerised system. Explain the stages of the systems life cycle that must be completed after the design stage and describe the documentation that the analyst must produce. The quality of written communication will be assessed in your answer to this question. [8]

QUESTION 2 Four in a Row is a game where two players drop coloured discs into a grid, with the aim to get four of their own colour in a row. Each player is given a set of coloured discs, red (R) or yellow (Y). The players take it in turns to drop their disc into a column in the grid. The disc drops down to the lowest available space in that column. The grids below (Fig 7.1 and 7.2) show what happens when the yellow player drops a disc into column 2: The game continues until one player has got four discs of their colour in a straight row in any direction i.e. vertical, horizontal or a diagonal. A programmer is going to use decomposition to help produce the game. Explain how decomposition can be used in the design of the game Four in a Row. [2]

The program will allow the players to take it in turns to make a move. Each move will be checked to ensure it is valid (i.e. the column is not already full). After each move the program will check if that player has won by checking the horizontal, vertical and diagonal positions to confirm if that player has four discs in a row. The programmer has developed a top-down design for the program as shown in the structure diagram Fig 7.3. Add one further level to the structure diagram, by dividing the sub-modules Player move, Check valid and Check won into further sub-modules. [3] The structured design for this program makes use of pipelining. Describe one example of where pipelining could be used in this program. [2]

A 2-dimensional array, grid, is used to hold the game grid. Using pseudocode, write a function that takes as input the player whose turn it is, and the column number they select as their turn. The function either: Returns 999 (i.e. the column is already full), or Stores the player s move in the array and returns the row the disc has been placed in Annotate your pseudocode with comments to show how it solves the problem. [6]

After a player makes their move, the program needs to check if that player has won (i.e. the player has four discs in a row). Subroutines have already been written to check if the player has won vertically, or diagonally. Using pseudocode, write a procedure that reads appropriate parameters and checks if the player has won horizontally. If the player has won, display an appropriate message identifying which player has won. [6]

The programmer is writing a new version of the game, where each player removes one disc from the bottom row of the grid before a new move is made. In the example below, player R removes one disc from column 2 (before) and places one in column 4 (after). The programmer has to decide whether to continue to use a 2D array or produce an array of queues. Evaluate the use of 2D array of queues to perform this action.

[9] Explain why a stack would not be an appropriate data structure for this revised game. [2] A procedure needs to be written to remove the disc from the chosen column. The procedure will: Have the column the disc is being removed from as a parameter Move each disc in that column down to the bottom of the grid Replace the top space with an empty string ( ) Complete the algorithm below. [3]

The programmer is adding a feature that allows a player to play against the computer. Explain how the programmer could make use of a tree structure, using a heuristic approach in the development of the computer player. [7]

QUESTION 3 José works for a company that provides loans to its customers. When customers take out a load they decide how much money to borrow and for how many years. The interest rate is currently 10% but it may change in the future. José writes the following program to calculate the monthly payment for a loan. Using the code above, show the value that will be output if the inputs are: Amount: 600 Years: 5 You must show all your working. [3] Parentheses have been used in lines 09 and 10. State why the parentheses in line 09 are not essential. [1]

Explain why the parentheses in line 09 are useful. [2] Explain why the parentheses in line 10 are essential. [2]

QUESTION 4 A procedural programming language may use procedures. Explain the term procedural programming language. [2] The same variable name may be used in more than one procedure in a programming. Explain how a variable named result may be used in different procedures without causing errors. [2] Explain parameter passing. [5]

Algebraic notation may in infix or reverse Polish. Convert (p q)/r to reverse Polish. [2] Convert stu*+ to infix. [2]

QUESTION 5 Variables are used in programming. Describe the use of local variables. [4] State two features of global variables that distinguish them from local variables. 1 2 [2]