Computer-Science-A-level-Ocr
-
3-3-networks8 主题
-
3-2-databases7 主题
-
3-1-compression-encryption-and-hashing4 主题
-
2-5-object-oriented-languages7 主题
-
2-4-types-of-programming-language4 主题
-
2-3-software-development5 主题
-
2-2-applications-generation6 主题
-
2-1-systems-software8 主题
-
1-3-input-output-and-storage2 主题
-
1-2-types-of-processor3 主题
-
1-1-structure-and-function-of-the-processor1 主题
-
structuring-your-responses3 主题
-
the-exam-papers2 主题
-
8-2-algorithms-for-the-main-data-structures4 主题
-
8-1-algorithms10 主题
-
7-2-computational-methods11 主题
-
7-1-programming-techniques14 主题
-
capturing-selecting-managing-and-exchanging-data
-
entity-relationship-diagrams
-
data-normalisation
-
relational-databases
-
hashing
-
symmetric-vs-asymmetric-encryption
-
run-length-encoding-and-dictionary-coding
-
lossy-and-lossless-compression
-
polymorphism-oop
-
encapsulation-oop
-
inheritance-oop
-
attributes-oop
-
methods-oop
-
objects-oop
-
capturing-selecting-managing-and-exchanging-data
-
6-5-thinking-concurrently2 主题
-
6-4-thinking-logically2 主题
-
6-3-thinking-procedurally3 主题
-
6-2-thinking-ahead1 主题
-
6-1-thinking-abstractly3 主题
-
5-2-moral-and-ethical-issues9 主题
-
5-1-computing-related-legislation4 主题
-
4-3-boolean-algebra5 主题
-
4-2-data-structures10 主题
-
4-1-data-types9 主题
-
3-4-web-technologies16 主题
-
environmental-effects
-
automated-decision-making
-
computers-in-the-workforce
-
layout-colour-paradigms-and-character-sets
-
piracy-and-offensive-communications
-
analysing-personal-information
-
monitoring-behaviour
-
censorship-and-the-internet
-
artificial-intelligence
-
the-regulation-of-investigatory-powers-act-2000
-
the-copyright-design-and-patents-act-1988
-
the-computer-misuse-act-1990
-
the-data-protection-act-1998
-
adder-circuits
-
flip-flop-circuits
-
simplifying-boolean-algebra
-
environmental-effects
decisions-in-computational-thinking
Identify the Points in a Solution where a Decision has to be Taken
-
Most languages use structured programming techniques including:
-
Sequence: one statement after another
-
Selection: Decision making, if/then/else, switch/case
-
Iteration: Loops, for/while/do while/do until
-
-
The purpose of these techniques is to aid the readability, understanding and maintainability of code
-
Python is an example of a block-structured language, which uses only these three constructs to control the flow of execution and data in a program. Each block of code should have a single entry and exit point and ideally minimise breaking out of iterative blocks. This is to prevent unintended consequences relating to the flow of control of a program such as entering or leaving a subroutine early or branching unintentionally
-
When designing algorithms, it is always best to plan the algorithm using flowcharts, pseudocode or structured english before coding in a language
-
Languages have specific syntax, constructs and idiosyncrasies that differ between other languages. This makes it challenging to create a solution that can immediately be implemented in another language
-
When determining the points in a solution where decisions are made, flowcharts are useful as they visually show the flow of control in a program. Decisions are clear and easy to follow, however flowcharts are time consuming to create
-
Pseudocode more accurately mimics the constructs of programming languages without the problem of syntax. As pseudocode has no syntax, any way of expressing an algorithm is acceptable as long as the pseudocode meaning is clear
-
Structured English can be an alternative to pseudocode but is usually more verbose and imprecise
How do you Identify the Points in a Solution where a Decision has to be Taken?
-
Most errors in a program occur when evaluating a Boolean condition, whether in a sequence as part of a statement, iteration or selection. It is therefore important to be careful when creating Boolean conditions, especially long, complex conditions involving multiple clauses
-
Decisions in programs usually occur in two situations, an if statement/select case or a loop, usually a while loop
-
Selection, also known as branching, involves directing the flow of control of a program, dependent on a Boolean condition or set of conditions
-
Iteration involves repeating a sequence of instructions based on a stopping Boolean condition
Determine how Decisions Affect Flow through a Program
-
Decisions affect the flow of control of a program
-
Decisions are Boolean conditions encountered in selection structures such as if/then/else statements and iteration structures such as while loops
-
If statements and switch/case statements can consist of many decision points as illustrated below. Each decision point directs the program through different statements
if/then/else example
if today == “Monday” then print(“Eugh! Monday again!”) elseif today == “Tuesday” then print(“Tuesday, one day closer the weekend!”) elseif today == “Wednesday” then print(“Half way there!”) elseif today == “Thursday” then print(“One more day to go!”) elseif today == “Friday” then print(“I can’t believe its Friday!”) elseif today == “Saturday” then print(“Woo! Its Saturday!”) elseif today == “Sunday” then print(“Aww, its Monday tomorrow!”) else print(“That’s not a day!”) endif
switch/case statement example
switch entry: case “Monday”: print(“Eugh! Monday again!”) case “Tuesday” print(“Tuesday, one day closer the weekend!”) case “Wednesday”: print(“Half way there!”) case “Thursday”: print(“One more day to go!”) case “Friday”: print(“I can’t believe its Friday!”) case “Saturday”: print(“Woo! Its Saturday!”) case “Sunday”: print(“Aww, its Monday tomorrow!”) default: print(“That’s not a day!”) endswitch
-
Iteration and selection statements can be nested, leading to a structure as shown below
Count ← 0 REPEAT INPUT Score[Count] IF Score[Count] >= 70 THEN Grade[Count] ← "A" ELSE IF Score[Count] >= 60 THEN Grade[Count] ← "B" ELSE IF Score[Count] >= 50 THEN Grade[Count] ← "C" ELSE IF Score[Count] >= 40 THEN Grade[Count] ← "D" ELSE IF Score[Count] >= 30 THEN Grade[Count] ← "E" ELSE Grade[Count] ← "F" ENDIF ENDIF ENDIF ENDIF ENDIF Count ← Count + 1 UNTIL Count = 30
-
Each if statement contains another if statement which affects the flow of the program. This is however functionally identical to the days of the week program shown above
Responses