Chapter 2 Primary Data Types Flashcards

1
Q

What is RAM and what is it composed of?

A

Random Access Memory is a computer’s short-term memory or volatile memory. It is composed of fixed-size cells, with each cell number referenced through an address.

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

What are common variable characteristics?

A

Name: Variable name used to reference data in program code
Type: Number, character, etc.
Value: Data value assigned to variable’s memory location
Address: Assigned to variable, which points to a memory cell location

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

What are two actions needed to create variables?

A

Declare (int x;) and initialize (x = 0;)

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

What is needed when assigning character data to character variables?

A

Character data must be enclosed in single quotes (‘), AKA tick marks or apostrophes.

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

What is the keyword for integer data types?

A

int

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

What is the keyword for character data types?

A

char

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

What is the keyword for floating-point number?

A

float

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

What is the difference between int, char, and float data types?

A

Integer data types consist of positive and negative whole numbers.

Character data types consist of ASCII character sets that represent integer values (e.g., character code 90 = Z)

Floating-point numbers consist of large and small, positive and negative decimal numbers (09.4543)

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

What is the ASCII?

A

American Standard Code for Information Interchange

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

What are conversion specifiers?

A

They tell the program how to display the variable and their corresponding data types.

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

What are common conversion specifiers?

A
%d = Displays signed integer value
%f = Displays signed floating-point value
%c = Displays single character value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are constant data types?

A

Read-only variables that cannot lose their data values during program execution.

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

What are common rules for naming variables?

A
  1. Begin with lowercase letter
  2. No spaces
  3. Only letters, numbers, and underscores (_)
  4. Fewer than 31 characters (ANSI C standard)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are best practice programming conventions and styles?

A
  1. Use of white space should be consistent
  2. Appropriate usage of upper and lower case letters
  3. Self-documenting variable names (data type prefix & purpose)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does the scanf(0) function do?

A

Reads standard input from the keyboard and stores it in previously declared variables

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

What operator is required when using the scanf() function?

A

The address (pointer) operator “&”

17
Q

What is the correct way to state the “=” operator?

A

It is an “assignment” operator rather than “equals”

18
Q

What are some common unstructured numeric data types?

A

integers and floating-point numbers

19
Q

What are some common unstructured non-numeric data types?

A

character and boolean

20
Q

What are some common structured data types?

A

arrays, structures, classes, and files

21
Q

What is the Negation operator in reference to logical operators?

A

The Negation operator is the “!” which is used on Boolean variables that causes the variable to flip its Boolean assignment.

If x = true, then !x = false

22
Q

What are the 6 relational operators?

A
  1. Equality (==)
  2. Inequality (!=)
  3. Greater than (>)
  4. Greater than or equal to (>=)
  5. Less than (
23
Q

What is the difference between = and ==?

A

= is the assignment operator when assigning values to variables.

== is the Boolean equality operator to verify if two operands are equal.