Topic 2 Flashcards

1
Q

When solving a programming problem, try to use a

A

Modular Approach

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

is a program consisting of interrelated statements arranged in logical and understandable form

A

modular program

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

is referred to as a small segment which is designed to perform a specific task

A

Module

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

is a symbolic identifier for a memory address where data can be held

A

variable

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

used to name storage locations

A

Variable

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

is a memory location whose contents can
vary, also called an identifier

A

variable

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

Name must be a __________,
but can be formed from several
words

A

single word

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

First character must be a ________
or _____________

A

letter, underscore

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

Only ______, ______, and ____________ may follow the initial letter ( no blanks or spaces allowed )

A

letters, digits, underscore

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

____________ cannot be used as
identifiers

A

Keywords

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

Variable names are ____ __________

A

case sensitive

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

Keywords are also referred to as ________ _____, for they cannot be used as variable names

A

reserved words

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

Conventions

A
  • Use underscore to separate
    words, for readability
  • Or, capitalize the first letter of
    each word (Pascal Case)
  • Be mindful of using some characters:
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Invalid Identifiers

A
  • begins with a number
  • contains a special character
  • a keyword
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

: ordering of data types
by size

A

Data Hierarchy

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

: single symbol
*“A”, “7”

A

Character

17
Q

: group of characters forming a
single data item
* “smith”

A

field

18
Q

: a group of related fields
* Customer record containing name and
address fields

A

Record

19
Q

: a group of related records
* Customer file, containing all customer
records

A

File

20
Q

: collection of related files,
called tables, that serve the
information needs of the organization

A

Database

21
Q

Two basic data types:

A
  • text
  • numeric
22
Q

____________ stored by numeric
variables

A

Numeric data

23
Q

stored by string, text, or
character variables

A

Text data

24
Q

Values that do not change while the
program is running

A

constants

25
Q

A specific numeric value that does not change.

A

Numeric Constant

26
Q

String of characters enclosed within “ “.

A

String Constant

27
Q

Do not have identifiers like variables do

A

Unnamed Constants

28
Q

: whole numbers only

A

integer

29
Q

: fractional numeric
values with decimal points

A

floating-point

30
Q

Assignment statement :

A
  • Assigns a value to a variable
  • Variable must appear on the left side, value on the right side of the
    assignment operator
  • Right side may be an expression that will be evaluated before storing the
    value in the variable
31
Q

Assignment operator :

A

: the equal sign (=) in most languages

*Always operates from right to left.

32
Q

Used to store a value into a
variable

A

Assignment statement

33
Q

Specifies the data type and identifier of a variable. It sets up the memory location

A

Declaration Statement

34
Q

Common Programming errors

A
  • Substituting letter O for zero (0) and vice versa
  • Failing to declare ALL variables
  • Storing incorrect data type into a variable
  • Attempting to use a variable with no value
  • Dividing integer values incorrectly
  • Mixing data types in the same expression
35
Q

holds digits and perform mathematical operations on it, also decimals and +/-.

A

Numeric Variable

36
Q

can hold text, letters of the alphabet, and special characters like “!”.

A

String variable

37
Q

only if it is the correct type.

A

Assign Data to a variable

38
Q

Similar to a variable and can only be assigned a value once. A useful name should be assigned to a value that will never change throughout the execution

A

Named Constant

39
Q

An unnamed constant with no immediate apparent purpose. Should be avoided.

A

Magic Number