Notes regarding programming theory for gcses and a level. Detailed explanation of the most important topic for Computer systems. Helps with homework and better exam results.
Written by a previous student, so included only the most essential material.
ALGORITHM
- A set of instructions for the computer to do certain tasks
FLOWCHART AND PSEUDOCODE
- Pseudo code is a generic code that is used in program design. A simplified
programming language that anyone can understand.
THE BIG 3 construct
- Sequence → in order
- Selection → e.g. IF statement
- Iteration → e.g. for loop, while loop#
DATA STRUCTURES
Algorithms + Data structures = Programs
- TREE → branches
- LIST → different data types
- GRAPH → nodes, edges
Syntax = rules and grammar of programming language.
VARIABLE AND CONSTANT
Variable = single entity. You can declare it and assign to a value which can change when the
code is running
- Unlike Constant which stays the same (e.g. Pi = 3.14…)
Var name As String = “Win”
- Var is variable and keyword
- Name is identifies
- As String is a data type and keyword
- = is assignment
Every variable you declare should be used. Variables are also memory location. Every
variable is one memory address.
- “...” syntax for STRING
- Win is a value you assign into
, Keywords are reserved words that cannot be used as an identifier.
GLOBAL AND LOCAL VARIABLE
Global = outside the sub routine
A variable that is in memory location which declares outside of the either function or
procedure. It can be called by any subroutine in the program but if the variable name is used
elsewhere, it can cause an error.
- Bad for large programs as it can conflict with other variables.
Local = inside the sub routine
The Main difference is the variables are declared inside the sub routine. So only that
subroutine can use the variable but it's safer and less chance of conflict.
DATA TYPE
STRING: character combinations
CHARACTER: letter symbols, digits, etc
REAL: fractions
INTEGER: whole numbers
BOOLEAN: true or false
OPERATORS
Arithmetic: + - / * ^ % MOD DIV
Comparison: == != >= < > <= <>
Logical: AND OR NOT
Var name As String = “Win”
If name == “Win”
Print (“Welcome” + name)
= assignment statement
== checking the condition
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller raenotes. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $3.89. You're not tied to anything after your purchase.