2.1.1 Thinking Abstractly Flashcards

1
Q

Exam Question: Define the term abstraction (1)

A
  • Removing characteristics/ elements/ detail from a problem
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Abstraction can be split into what 2 parts

A
  • Control abstraction:
    • Hides actions and programming controls such as if statements.
    • High level programming languages - hiding machine code from the user
  • Data Abstraction:
    • Hides how bits are organised for primitive data types (cant be simplified further) such as floating point (fractions/numbers after decimal point) or dates
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why do we need abstraction

A
  • Allows key ideas of a problem to be considered withot being bogged down with the exact nature of implementation (executing)
  • Most problems in computer science are complex, unless simplified they are too difficult to work on as a whole
    • There may be too many variables, by focussing on important aspects, we can simplify and look for a solution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the advantages of abstraction

A
  • We arent concerned about how the idea will be implemented - we can improve implementation later
  • Enables us to swap implementations in and out when more efficient models are found, without impacting functionality.(e.g binary search doesnt take sorting into account. Swap sorting algorithms not impact binary search)
  • Allows the developer to concentrate on the problem by simplifying complications
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Exam Questions: Identify 2 reasons why abstraction is needed in the rail network program (2)

A
  • Reduce Processing requirements
  • Simplify programming
  • Reduce memory requirements
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is an API

A
  • Python has a set of built in functions (application programming interface) which have been written by developers
  • They will have written the functions open, write and close to make a call to the kernel (all file access goes through the Kernel.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly