Edexcel GCSE Computer Science Decomposition & Abstraction PDF
Document Details
![DignifiedAqua726](https://quizgecko.com/images/avatars/avatar-3.webp)
Uploaded by DignifiedAqua726
Edexcel
Tags
Summary
This document provides notes on decomposition and abstraction in computer science, focusing on GCSE Computer Science concepts. It uses examples such as computer games to illustrate these principles.
Full Transcript
Head to www.savemyexams.com for more awesome resources Edexcel GCSE Computer Your notes Science Decomposition & Abstraction Contents Decomposition & Abstraction Benefits of Using Subprograms...
Head to www.savemyexams.com for more awesome resources Edexcel GCSE Computer Your notes Science Decomposition & Abstraction Contents Decomposition & Abstraction Benefits of Using Subprograms Page 1 of 8 © 2015-2025 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers Head to www.savemyexams.com for more awesome resources Decomposition & Abstraction Your notes Decomposition What is decomposition? Decomposition is the process of breaking down a large problem into a set of smaller problems Benefits of decomposition are: Smaller problems are easier to solve Each smaller problem can be solved independently of the others Smaller problems can be tested independently Smaller problems can be combined to produce a solution to the full problem An examples of decomposition in computing is: Computer games Modern computer games are decomposed to break down the complexity of the problem into more manageable 'chunks' Creating an entire game at once would be challenging and inefficient, so it could be decomposed into: Levels - Levels can be designed/created/tested/ independently of other levels Characters - The mechanics of characters in the game can be designed and created by a separate team Landscape - The art team can work on the visual aspects of the game without needing to understand how the game is programmed Once all of the smaller problems are completed, joined together a complex game has been created Abstraction What is abstraction? Abstraction is the process of removing unnecessary details of a problem to focus on the important features to implement in a solution Examples of abstraction include modelling a real-life object, environment, action, sequence of actions or concept. Page 2 of 8 © 2015-2025 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers Head to www.savemyexams.com for more awesome resources Implementations of these include: a computer game that simulates playing a sport Your notes a simulator such as a car or flight simulator, a map of a bus or train route in a city When creating a program, developers must identify important features that will contribute to solving the problem or have a role to play in the solution Computer games Computer games use a large amount of abstraction, removing the elements that a user does not need to consider in order to enjoy playing the game When using abstraction in computer games which are designed to simulate real life, the aim is to make the game realistic and visually appealing whilst keeping the game fun to play In a game that simulates a sport, it is important to the user that visually they recognise the environment and when they perform an action, they see a response However, users do not need to know the complex algorithms used to control the non player characters (NPCs) Page 3 of 8 © 2015-2025 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers Head to www.savemyexams.com for more awesome resources Train map Your notes Page 4 of 8 © 2015-2025 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers Head to www.savemyexams.com for more awesome resources Your notes Page 5 of 8 © 2015-2025 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers Head to www.savemyexams.com for more awesome resources Your notes Another specific example of abstraction would be the London underground train route map; travellers do not need to know the geographical layout of the routes, only that getting on at stop A will eventually transport you to stop B Worked Example Jack plays rugby at his local rugby club. He wants to create a program to store the results of each rugby match they play and the names of the try scorers. Define what is meant by abstraction Give one example of how abstraction could be used when developing this program Answer Abstraction is removing unnecessary detail from a problem in order to focus on the parts of the problem that need solving Simplifies the problem // reduces complexity // easier to solve Any suitable example of abstraction as long as it is relevant to the system Examples of what to ignore/hide/remove: Time the try was scored Player shirt number Venue Examples of parts to focus on: Player name Match result Tries scored Page 6 of 8 © 2015-2025 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers Head to www.savemyexams.com for more awesome resources Benefits of Using Subprograms Your notes Introduction to Using Subprograms What is a subprogram? Subprograms are an out of line block of code that may be called by simply writing their name in a program Subprograms are given a unique name so they can be called anywhere in a program There are many benefits to using Subprograms, these include Making bigger problems easier to break down (decompose) and code Allows team members to be able to work on different parts of a problem Makes the program easier to debug Makes programs more efficient as code is not duplicated There are two main types of subprogram: Procedures - does not return a result Functions - returns one or more results to the calling code Examples of using subprograms Python code # Subprogram 1 - Procedure def Information() #define a subprogram named 'information' first_name = input("Enter a name") surname = input("Enter a name") # Subprogram 2 - Function def Tax(pay_per_hour, hours_worked) #define a subprogram that takes 2 parameters total = pay_per_hour * hours_worked net_pay = total * 0.8 return net_pay Page 7 of 8 © 2015-2025 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers Head to www.savemyexams.com for more awesome resources #Main program starts here Information() #call subprogram 1 Your notes print(Tax) #call subprogram 2 Page 8 of 8 © 2015-2025 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers