0% found this document useful (0 votes)
7 views23 pages

Decomposition and Abstraction

The document discusses computational thinking, emphasizing decomposition and abstraction as key processes in problem-solving for computer-related tasks. Decomposition involves breaking down complex problems into smaller, manageable parts, while abstraction focuses on filtering out unnecessary details to highlight important aspects. Examples include creating an app, solving a crime, and simulating a game, illustrating how these concepts apply in various scenarios.

Uploaded by

allenisemo4281
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views23 pages

Decomposition and Abstraction

The document discusses computational thinking, emphasizing decomposition and abstraction as key processes in problem-solving for computer-related tasks. Decomposition involves breaking down complex problems into smaller, manageable parts, while abstraction focuses on filtering out unnecessary details to highlight important aspects. Examples include creating an app, solving a crime, and simulating a game, illustrating how these concepts apply in various scenarios.

Uploaded by

allenisemo4281
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Decomposition and Abstraction

Computational Thinking

• The thought processes


involved in formulating
problems and their
solutions so that can be
effectively carried out
by a computer.
• Computational thinking
enables you to work
out exactly what to tell
the computer to do.
Decomposition

• Breaking a problem
down into smaller, more Solving a noughts and crosses Game ( tic-tac-toe)
manageable parts, which
are then easier to solve.
• sub-problems can be
worked on by different
teams at the same time.
Make a Breakfast
Solving a crime

• what crime was committed


• when the crime was committed
• where the crime was committed
• what evidence there is
• if there were any witnesses
• if there have recently been any similar
crimes
How would you decompose the task of creating an app?

• what kind of app you want to create


• what your app will look like
• who the target audience for your app is
• what your graphics will look like
• what audio you will include
• what software you will use to build your app
• how the user will navigate your app
• how you will test your app
• where you will sell your app
You have been asked to write a program that will calculate how much an
hourly paid employee will earn per week. Make a list that decomposes the
problem.
Abstraction
I was walking down the street when I
saw a cat

• the process of removing or


hiding unnecessary detail so
that only the important points
remain.
• filtering out – essentially,
ignoring - the characteristics
that we don't need
Draw a cat

• know that it has a tail, fur,


legs and eyes
• don't need to know what
sound a cat makes or that
it likes fish.
• the idea of how to draw a
cat, is called model
Baking a cake
• a cake needs ingredients
• each ingredient needs a specified quantity
• a cake needs timings
London Underground map. Explain why the map is an abstraction of the
London Underground.
• distance of journey; cost of fuel; fuel usage of vehicle; distance / fuel
usage.
Level of Abstraction

• There are different levels or types of abstraction.


• The higher the level of abstraction, the less detail is required.
noughts and crosses Game ( tic-tac-toe)
Subprograms

select_category
display_Q&A
check_response
update_score
mark_asked_questions
establish_winner
Algorithm to simulate spinning the wheel to select a colour

Select a random number between 0 and 3.


If the number is 0 then display a red square on the screen.
If the number is 1 then display a blue square on the screen.
If the number is 2 then display a green square on the screen.
Otherwise display a yellow square on the screen.

You might also like