ENGR 120: Weeks 1 - 4 Vocabulary

4.5(2)
studied byStudied by 24 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/64

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

65 Terms

1
New cards

Variable

A place where data can be stored, including a name, a place in the memory, and a stored value

2
New cards

Variable Declaration

A statement we use to tell the compiler about a variable

3
New cards

Variable Format

<type> <variable name>;

4
New cards

int

integer, meaning whole number

5
New cards

double

real number, which includes fractions, decimals, integers

6
New cards

%f

floating-point (real numbers)

7
New cards

%10.2f

0 total characters (including the decimal point) with 2 of them being decimal places.  So that will be 7 positions for the integer part (with one being the negative sign if we need one), one for the decimal point, and two for the fractional part.  The integer positions will be left padded with spaces if the number doesn’t fill them and the fractional part will be right-filled with zeroes if necessary.

8
New cards

%d

integers

9
New cards

%c

character

10
New cards

printf

the code that comes from the stdio library (must have #include <stdio.h> in the code) and is how outputs are sent to the screen

11
New cards

Format String

Specifies how our values should be formatted

12
New cards

Prompt

Telling the user what we want them to do

13
New cards

\n

Hits enter when printing a line

14
New cards

Integer Division

Division between 2 integers, quits at the decimal point

15
New cards

Real Division

Division between 1 or more real numbers, divides all the way

16
New cards

scanf

Gets input from the keyboard

17
New cards

Mod Operator (%)

Gives the remainder after division

18
New cards

# (Pound)

Signifies a directive to the compiler’s preprocessor

19
New cards

#define

Tells the preprocessor to replace the <name> with the <stuff> throughout the code.

20
New cards

=

Means to assign a value

21
New cards

==

Means equal to

22
New cards

{ } Curly Brackets

Surround blocks of code, used to encase the information inside of functions

23
New cards

Reserved Words

(int, double, return, etc.) are always lowercase and should never be the name of a variable or parameter

24
New cards

Standard Identifiers

Redefined by the programmer, e.g. scanf, printf, variables.

25
New cards

Right Hand Side

Expression that evaluates what we want to store

26
New cards

Left Hand Side

Variable we want to store the result

27
New cards

Input Operation

Get data from the world

28
New cards

Output Operation

Get data to the world

29
New cards

Why do we use two's complement over one's complement?

There is only one way to encode 0

30
New cards

x = 42;

x gets the value of 42

31
New cards

#include

The #include directive tells the preprocessor to get another file, copy its content, and then insert it into the source code.

32
New cards

Signed Magnitude

Top bit as sign bit, two ways to represent 0

33
New cards

One’s Complement

Negation, flip all the bits, two ways to represent 0

34
New cards

Two’s Complement

Negation, flip all the bits and add 1, only one way to represent 0

35
New cards

byte

an integer type that holds 8 bits

36
New cards

char

Holds characters stored in ASCII

37
New cards

short

An integer type that holds at least 16 bits

38
New cards

Declaration Of A Function

return type> <function name> ( <parameter list> ) { <code> }

39
New cards

Increment ++

Add one

40
New cards

Decrement - -

Subtract one

41
New cards

Call Stack

Shows the order of the functions that are called in the c file.  It keeps track of the variables for each in-progress call and the information necessary to return from one call to the place it called.

42
New cards

RSP (Stack Pointer)

Top of the stack

43
New cards

Write an assignment statement that will convert that to uppercase and store it into a char variable named upper_ch.

upper_ch = (char)(ch - ('a' - 'A'));

44
New cards

RBP

Points to the base of the currently executing stack frame

45
New cards

If Statements

If the condition is true, the compiler will complete the code in the then block, if not true it will skip the then block

46
New cards

If-Else Statements

If the condition is true, it will run the code in the then block, if false it will run the code in the else block

47
New cards

&&

Logical AND, true if both operands are true

48
New cards

| |

Logical OR, true if either operand is true

49
New cards

!

Logical NOT, true if the operand is false

50
New cards

Border Case

A situation where a small change in values causes a fundamentally different behavior

51
New cards

assert(<condition>)

Just makes sure that certain condition is true. If so it keeps running the code. If not, the code is stopped and an error occurs.

52
New cards

Switch Statements

A way to select one code block to execute from multiple options, based on the value of an expression

53
New cards

Header Guard

In case one include file includes others and that makes one source file accidentally include it more than once.

54
New cards

CMake

Tool that lets us specify how our projects should be built

55
New cards

#ifndef

Taking groups of related functions and putting them into different .c files makes it easier to read the code and not be so confusing.

56
New cards

Enums

Type we create that has a discrete ordered set of values

57
New cards

While Loop

A condition is evaluated and if it is true, the information inside the loop happens, and then it goes back to the top and evaluates the information again. This will continue until the condition evaluates to false at which point execution continues beyond the end of the while loop will run if that condition is true

58
New cards

While Loop Format

while(<condition>)

{

    // what is done

}

59
New cards

For Loop Format

for(i=0; i <condition>; i++)

{

//what is done

}

60
New cards

Count-Controlled Loops

Stops when the loop has happened a specific number of times. Before the loop starts, we’ll know how many times it will run. For loops are preferred for count-controlled loops.

61
New cards

Sentinel-Controlled Loops:

These loops run until a particular condition is true and they may run any number of times before that condition becomes true (we don’t know ahead of time). Generally, we code sentinel-controlled loops using while statements.

62
New cards

Short-Cutting Evaluation

When we are building conditions that include && or ||, the order of the operations matters

The machine will evaluate the left-hand operand first. If that determines the value of the && or ||, the right-hand operand will not be evaluated.

63
New cards

Guard Conditions

These are extra terms that help stop a loop before wandering off the end of the array.

64
New cards

Break

The statement that is true will run and then the break stops the loop and jumps to the first line after the loop body (“getting out” of the loop)

65
New cards

Continue

It takes you back to the top of the loop and therefore skips the rest of the loop body for that pass through the loop. It is most commonly used when you are going through a big data set, but only want to do stuff to some of the records