Unit 8.1 Programming Principles

studied byStudied by 3 people
0.0(0)
Get a hint
Hint

Describe the 4 stage or problem solving in Computer Science.

1 / 8

flashcard set

Earn XP

9 Terms

1

Describe the 4 stage or problem solving in Computer Science.

  1. Decomposition, it is when you break a problem down into smaller tasks so it is easier to solve

  2. Abstraction, it is when you ignore the unnecessary information and focus only on the important facts

  3. Pattern recognition, it is the process of identifying similar pattern within a problem

  4. Algorithm, it is the final stage as step by step rules are created to solve the problem.

New cards
2

3 idea/construct of programming

  1. Sequence, it is structuring code into a logical, sequential order.

  2. Selection, it is the decision making using if statement

  3. Iteration, repeating code, often using for loops or while loops

New cards
3

What is local variable

variables are declared within a specific subroutine and can only be used within that subroutine.

New cards
4

What is global variable

variables can be used at any point within the whole program.

New cards
5

Advantage of local variable

Local variable advantages

  • Saves memory - only uses memory when that local variable is needed - global variables use memory whether they are used or not.

  • Easier to debug local variables as they can only be changed within one subroutine.

  • You can reuse subroutines with local variables in other programs.

New cards
6

Advantage of local and global variable

Local variable advantages

  • Saves memory - only uses memory when that local variable is needed - global variables use memory whether they are used or not.

  • Easier to debug local variables as they can only be changed within

Global variable advantages

  • Variables can be used anywhere in the whole program (and in multiple subroutines).

  • Makes maintenance easier as they are only declared once.

  • Can be used for constants value that remain the same

New cards
7

What is a constant

A constant is data that does not change in value as the program is run - it is fixed and remains the same.

New cards
8

What is counts and rogue value

A count is a variable that is used to record the current iteration (loop number).

A rogue value is an unexpected value that will cause the loop to end.

New cards
9

What is self-documenting identifier

It is an efficient program will use variables with sensible names that immediately state their purpose in the program.

New cards

Explore top notes

note Note
studied byStudied by 17 people
... ago
5.0(2)
note Note
studied byStudied by 21 people
... ago
5.0(1)
note Note
studied byStudied by 1 person
... ago
5.0(1)
note Note
studied byStudied by 70 people
... ago
5.0(1)
note Note
studied byStudied by 6 people
... ago
5.0(1)
note Note
studied byStudied by 1 person
... ago
5.0(1)
note Note
studied byStudied by 34 people
... ago
5.0(2)
note Note
studied byStudied by 63 people
... ago
5.0(1)

Explore top flashcards

flashcards Flashcard (65)
studied byStudied by 107 people
... ago
5.0(2)
flashcards Flashcard (141)
studied byStudied by 4 people
... ago
5.0(1)
flashcards Flashcard (27)
studied byStudied by 4 people
... ago
5.0(1)
flashcards Flashcard (28)
studied byStudied by 6 people
... ago
4.0(1)
flashcards Flashcard (42)
studied byStudied by 12 people
... ago
5.0(1)
flashcards Flashcard (23)
studied byStudied by 9 people
... ago
5.0(2)
flashcards Flashcard (96)
studied byStudied by 19 people
... ago
5.0(1)
flashcards Flashcard (198)
studied byStudied by 28 people
... ago
5.0(2)
robot