ESP - Week 4 Flashcards

1
Q

bool Datatype cast

A
i = int(true/false)
i = 1 or 0
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Constant syntax

A

const int int_name = number;

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

Static declarations

A

Keeps the value of a variable inside a loop without needing global scope

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

Defining new types

A

struct {
datatype type_name;
} structure_name;

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

enum syntax

A

enum {x, y, z} enum_name

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

Making a pointer

A

int *x;

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

What is the significance of int b[10];

A

b reserves space for 10 integers and points b at the first one (the zeroth)

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

What is the significance of char *h = “hello”;

A

h reserves space for 5 characters (h,e,l,l,o) and a zero and points a at the first

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

What is the significance of int l [] = {1,2,3,4,5};

A

l reserves space for 5 integers and points l at the first

type of l is also int *

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

What is the syntax for pointer arithmetic

A

int *list = {1,2,3,4,5}
int *a;
a = list;

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

Computational Models

A

Sequential - A set of statements
Communicating - Multiple sequence programs
OOP - Breaks complex software into simple pieces
Finite State - For control dominated systems

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

What is the purpose of a static data type

A

It is remembered forever

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

If a button used to be pressed and is not pressed now what has happened

A

It has just been released

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

How to get a bool value if a variable is defined

A

ifdef

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

From FSM to code (1)

A

enum all states
declare state variables
initialize
declare functions

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

From FSM to code (2)

A

single switch statement
each case handles actions of state
each case checks condition and sets next state

17
Q

Flowchart model

A

Terminals: Round
Operations: Rectangle
Decision: Diamond
Input/Output: Parallelogram

18
Q

Designing system

A

Design system first then implement it