Section 02: Algorithms and Programming Flashcards

1
Q

Define:

Algorithm:

A

A step-by-step procedure for solving a problem accomplishing some end

Ex: Recipe, assembly instructions, pseudocode, flowchart

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

What are the flowchart instructions?

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

Define

Program:

A

Translation of the algorithm using programming languages

Structure and details crucial

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

Define

Programming Languages

A

Formal languages designed communicate instructions to a computer

Low-Level vs. High-Level

Programs translate high to machine language:

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

Differentiate

“Low-Level” and “High-Level” Programming Languages

A
  1. ”Low-Level” Languages: Language “spoken” by computer (binary systems)
    • Hardware specific - must be specially made each brand computer

Categories:

1. *Machine language*: Directly understood computer & needs no translation (0100111100) 
2. *Assembly language*: Easier humans understand than machine codes 
  1. ”High-Level” Languages: PL use English and mathematical symbols to communicate instructions
    • Easier to read & program
    • Programs are PORTABLE (run on different kinds of computers)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Define

Compiler

A
  • Translates high-level
  • Once compiled, be run over and over again without needing to be retranslated
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Define

Interpreters

A
  • Translates source code line-by-line during execution
  • No object code or executable
  • If run code again, need run interpreters again
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is “Python”?

A

(1) High-level language & (2) interpreted language & (3) named after Monty Python

Advantages:

  1. Easy & concise
  2. Lots build-in functionality free and open source
  3. Can create pretty much any application
    - Write using text editor
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Define

Integerated Development Environment (IDE)

A

A program can be written using: An Integrated Development Environment (IDE) → Thonny ex

  • Made specially for writing code:
    1. Syntax highlighting, auto-completion
    2. Can run code directly in IDE
    3. Debugging tools
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Define

“Statement”

Ex: Print Statement

A
  • The Statement: Line of code preforms basic operation
    • Above: print statement and parenthesis indicates that print is a function in python

// “print statement” use to disply specific stat

print(“Hello World!”)

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

Code

Comments (#)

A
  • Comments: Annotations (#)Function:
    • Make easier read and understands
    • Choosing a good variable name can reduce num comments
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Define

Bugs and Debugging

A

Bugs: Incorrect/unexpected results & process tracking down mistake ⇒ Debugging

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

Define & Code

Escape Sequences

A

Escape sequences: sequence characters represents special character

(1) \n represents character “newline”
(2) \” or \’ represent quotation mark
(3) \t represents a tab

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

Define

Values

A

Basic things a program works with like n letter or num
- 2: integer
- 42.0: floating number point
- “Hello world”: string

If not sure about type of value; use type() to find out

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