Chapter 1 Flashcards
What is an algorithm
A step by step procedure, that computers and humans can follow, to solve problems.
List 3 ways to express algorithms:
List algorithm
Flow diagram
Pseudocode
What is an iteration instruction?
Repeating something a set number of times or until a condition is met
What is a selection instruction
A choice or a decision.
What is a sequence instruction?
A basic instruction
What makes a successful algorithm?
Accuracy - how successfully it solves the problem
Efficiency - how quickly it solves the problem
What shapes are in the flow diagram
Oval
Rectangle
Parallelogram
Diamond
Which shape does start/end require?
Oval
What shape does a simple sequence instruction require?
Rectangle
What shape does a user input or output require
Parallelogram
What shape does a selection statement require?(yes or no)
Diamond
5 rules of naming variable identifiers:
1) Must not contain spaces or begin with a number
2) Must be descriptive of its use
3) must be snake_case or camelCase
4) Can’t be too long
5) Cannot be a keyword
What is Pseudocode
A language that is similar to to a real programming language, but it is easier for humans to understand.
Used to plan your script before coding for real.
What is an operator?
The symbols that tell the computer what to do
What is an operand?
The data the operator works on