Component 2 Flashcards

1
Q

What is computational thinking?

A

It’s the process of breaking down a problem into simple enough steps that even a computer would understand.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the three core concepts of computational thinking?

A
  1. Decomposition
  2. Algorithmic thinking
  3. Abstraction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Decomposition?

A

Decomposition is when you break down a problem into smaller chunks so they can be solved individually.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Algorithmic thinking?

A

Algorithmic thinking is a logical way of getting to the solution, by taking the problems step by step.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Abstraction?

A

Abstraction is when you select only the important bits from the information given.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Pseudocode?

A

Pseudocode is a way of writing code in a way which is easier to understand.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a Flowchart?

A

A flowchart is a way of visually writing Pseudocode and Algorithims.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What shape is a terminal in flowcharts

A

Rounded box

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How does binary search work?

A
  1. Find the midpoint in the list
  2. If the midpoint is the item you are looking for stop program
  3. if item you are looking for is greater than the midpoint then check latter half of the list, if not there check other half.
  4. The list will be half the size, you would need to find the midpoint again and repeat.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What must be true for binary search to work?

A

The list must be in order(alphabetical or numerical)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does Linear Search work?

A

1.The program startes at the first item
2.It compares the item to what we’re searching for
3.If it doesn’t match, repeat until you reach the correct item.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the downside to Linear Search?

A

It is slower than binary search

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does bubble sort do?

A

It takes an unordered list, and puts it into order.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How does bubble sort work?

A
  1. Looks at the first two items
  2. If they are in the correct order, leave as is
  3. If they are in wrong order, swap
  4. Compare 2nd and 3rd and perform same check
  5. Repeat the process until list is in order.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How does merge sort split work?

A
  1. Split the list in halves until there is one item per list
  2. Merge each item with another item, compare values and rearrange
  3. Merge them all back together by making comparisons and swapping them around.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the pros and cons of merge sort split?

A

Pros: 1.More effecient, and quicker than bubble sort
2. Consistent running times, as you don’t backtrack as much.
Cons: 1. Not good for small lists
2. If the list is sorted it will still split
3. Uses memory to create many lists.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How does insertion sort work?

A

1.Check the 2nd item of the list and check if it is greater than the first item
2.If it is in order leave it and check 3rd item
3.Compare 3rd item with the numbers before and put it into the right place
4.Repeat

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are the Pros and Cons of insertion sort?

A

Pros: 1. Easy to program
2.Good for small lists
3.No extra memory required
4.Easy to add more items
Cons: 1. Bad with larger lists.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What shape box are inputs and outputs in flowcharts?

A

Parallelogram

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What shape are processes in flowcharts?

A

rectangles

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What shape are decisions in flowcharts?

A

diamonds

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What shapes are sub-programs?

A

Double lined rectangle.

look it up idk?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What are the Pros and Cons of bubble sort?

A

Pros: 1.Simple algorith that can be easily implemented
2. Effecient to check if list is sorted
3. Doesn’t use a lot of memoery
Cons: 1.Inneficient to sort a list
2. Doesn’t cope with large lists.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What are the Pros and Cons of bubble sort?

A

Pros:
1. Simple, so can be implemented easily
2. Effecient to check if list is in order
3. Doesn’t use much memory
Cons:
1. Inefficient to sort a list
2. Can’t cope with large lists.

25
Q

What does a NOT gate look like?

A

Triangle with circle at tip

26
Q

What does an AND gate look like?

A

An LED in real life

27
Q

What does an OR gate look like?

A

A streamlined arrow head shape

28
Q

What is a procedure?

A

A set of instructions stored uner one name, call the name of the procedure to run it.

29
Q

What is a function?

A

Similar to procedures, but they always return a value

30
Q

What is a parameter?

A

special variables used to pass values into a sub program

31
Q

What is an argument?

A

The actual value that the parameters take when a subprogram is called.

32
Q

Whats the difference between local and global variables?

A
  1. Local can only be used within the structure they’re declared in
  2. Global can be used any time after their declaration.
33
Q

What are the pros of using structure diagrams?

A
  1. Coding is easier
  2. Allows lots of people to work on a single program
  3. Easier to test your program with each individual module
  4. Individual modules can be fixed independently
  5. Can be re used in future.
34
Q

How can we make programs easier to maintain?

A
  1. Comments
  2. Indentation
  3. Named variables, sub programs and procedures
  4. using sub programs
35
Q

What is a SYNTAX ERROR?

A

When the compiler or interpreter doesn’t understand something you’ve typed because it doesn’t follow the rules or grammar of the programming language.

36
Q

What is a LOGIC ERROR?

A

When the compiler or interpreter is able to run the program, but the program does something unexpected.

37
Q

Low level languages vs High level languages - spot the difference.

A
  1. High level languages are easy for humans to write and understand, computer need it translated before it can be run.
  2. Low level languages are hard for humans to read and write, but easy for computers. Eg - Assembly or machine code.
38
Q

What are the Pros and Cons of high-level language?

A

Pros:
1. One instruction = many instructions in machine code
2. Same code works on many machines
3. Programmer can easily store data in structures(arrays or lists.)
4. Easy to read
Cons:
1.Must be translated before a computer can understand
2.Don’t have much control over what the CPU does, so programs are less memory efficient.

39
Q

What are the Pros and Cons of low level language?

A

Pros:
1.Can be executed directly without translator
2.You control what the CPU does and how it uses memory
Cons:
1. 1 instuction = 1 instruction of machine code
2. Only written for one machine type
3. Programmer needs to know about structure of CPU and how it works
4. Hard to read

40
Q

What’s the difference between compilers and interpreters?

A
  1. Compilers translate high level code directly into machine code, and create and executable file
  2. interpreters take each instruction in code and call machine code subroutines within their own code to run the instruction.
41
Q

What are the Pros and Cons of compilers?

A

Pros:
1. Translates all source code at same time and creates 1 executable file
2. Only needed once
3. Returns list of errors for entire program once compiling is done
Cons:
1. Program runs quickly once compiled, but compiling is long af sometimes.

42
Q

What are the Pros and Cons of Interpreters?

A

Pros:
1. Interpreter returns the first error then stop - good for debugging.
Cons:
1. No executable file
2. needed every time you want to run program
3. Program runs slower because code is being translated.

43
Q

What are records?

A

A data structure, like arrays, which can store values with different data types.

44
Q

What is input validation?

A

Checking if data meets certain criteria before passing it into the program

45
Q

What is defensive design?

A

Designing a program to function even when users try to use it incorrectly

46
Q

What 3 things will developers do to protect their programs?

A
  1. Anticipate how users might misuse the program
  2. Ensure the code is well maintainted
  3. Reduce the number of errors in the code through testing
47
Q
A
48
Q

What are the 5 input validation checks and what do they do?

A

1.Range check - checks its within a specific range
2.Prescence check - checks data has actually been entered
3.Format check - checks data is the correct format
4.Look-up check - checks data against a table of acceptable values
5.Length check - checks if its the correct length

49
Q

What are the 2 main types of testing?

A
  1. Iterative testing
  2. Terminal/final testing
50
Q

What is iterative testing and why is it used?

A
  1. The program is tested while it is being developed, usually just 1 module at a time.
  2. It is used to identify and fix small errors, which prevent larger errors from occurring later on.
51
Q

What is final testing, and why is it used?

A

1.When the whole program is tested at the end of the development process.
2.It is used to see if the program still works when the modules start working together

52
Q

What is a test plan?

A

A plan which outlines what you’re going to test in your program, and how you’re going to test it. It should cover all possible paths

53
Q

What is normal data?

A

Things the user is likely to input into the program

54
Q

What is boundary/extreme data?

A

Values at the limit of what the program should be able to handle

55
Q

What is invalid data?

A

Inputs with a correct data type that should be rejected by the program

56
Q

what is erroneous data?

A

Inputs with an incorrect data type that should be rejected by the program

57
Q

What is an IDE?

A

An Integrated Development Environment is a piece of software that provides features to a programmer to develop their program.

58
Q

What are some common features of IDEs?

A
  1. A translator(compiler of interpreter) which allows source code to be understood by the computer.
  2. Auto-documentation
  3. A GUI
  4. Debugging tool
59
Q

What is Auto-documentation?

A

1.Software which helps with the maintenance of programs.
2.It extracts certain features of aprogram, like the names of variables and subprograms.