Topic 2 Flashcards

(39 cards)

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”

17
Q

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

18
Q

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

19
Q

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

20
Q

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

21
Q

Two basic data types:

22
Q

____________ stored by numeric
variables

23
Q

stored by string, text, or
character variables

24
Q

Values that do not change while the
program is running

25
A specific numeric value that does not change.
Numeric Constant
26
String of characters enclosed within “ “.
String Constant
27
Do not have identifiers like variables do
Unnamed Constants
28
: whole numbers only
integer
29
: fractional numeric values with decimal points
floating-point
30
Assignment statement :
* 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
Assignment operator :
: the equal sign (=) in most languages *Always operates from right to left.
32
Used to store a value into a variable
Assignment statement
33
Specifies the data type and identifier of a variable. It sets up the memory location
Declaration Statement
34
Common Programming errors
* 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
holds digits and perform mathematical operations on it, also decimals and +/-.
Numeric Variable
36
can hold text, letters of the alphabet, and special characters like “!”.
String variable
37
only if it is the correct type.
Assign Data to a variable
38
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
Named Constant
39
An unnamed constant with no immediate apparent purpose. Should be avoided.
Magic Number