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 11 people
... ago
5.0(1)
note Note
studied byStudied by 9 people
... ago
5.0(1)
note Note
studied byStudied by 2701 people
... ago
4.8(12)
note Note
studied byStudied by 3 people
... ago
5.0(1)
note Note
studied byStudied by 14 people
... ago
5.0(1)
note Note
studied byStudied by 32 people
... ago
4.0(1)
note Note
studied byStudied by 23 people
... ago
4.7(3)
note Note
studied byStudied by 37186 people
... ago
4.9(69)

Explore top flashcards

flashcards Flashcard (78)
studied byStudied by 10 people
... ago
5.0(1)
flashcards Flashcard (200)
studied byStudied by 4 people
... ago
5.0(1)
flashcards Flashcard (98)
studied byStudied by 2 people
... ago
5.0(1)
flashcards Flashcard (32)
studied byStudied by 31 people
... ago
5.0(3)
flashcards Flashcard (25)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (69)
studied byStudied by 61 people
... ago
5.0(1)
flashcards Flashcard (71)
studied byStudied by 4 people
... ago
4.0(1)
flashcards Flashcard (29)
studied byStudied by 10 people
... ago
5.0(1)
robot