Mid-Term Chapter 1-5 Flashcards

1
Q

Define “Infinite Loop”

A

Continues to repeat until the program is interrupted

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

Define “Input Validation”

A

Process of inspecting data given to a program by the user and determining if it is valid

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

The while loop is especially useful for…

A

Validating input.

If invalid input is entered a loop can require the user reenter it as many times as necessary.

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

Define “Priming Read”

A

The read operation that takes place just before the loop.

It provides the first value for the loop to test. Subsequent values are obtained by the loop.

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

A “counter” is a variable that is regularly…

A

incremented or decremented each time a loop iterates

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

Sentinal controlled or sentinal value

A

Sentinel-controlled repetition is sometimes called indefinite repetition because it is not known in advance how many times the loop will be executed. It is a repetition procedure for solving a problem by using a sentinel value (also called a signal value, a dummy value or a flag value) to indicate “end of data entry”.

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

The do-while Loop is a ______ loop.

A

posttest loop, which means its expression is tested after each iteration.

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

What is the do-while format?

A

do
statement;
while (expression);

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

user-controlled loop

A

allows the user to decide the number of iterations (for example, again? Y/N

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

Use the do-while loop when you want the loop to run at least ____times

A

one time

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

The do-while loop is a good choice for repeating a _____.

A

menu

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

The for Loop is ideal for…

A

Performing a known number of iterations

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

The count-controlled (for Loop) must have what 3 elements?

A
  1. Initialize a counter variable to a starting value.

2. Test the counter variable by comparing it to a max value. When max reached, it terminates

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

Flowchart

A

diagram that shows the logical flow of a program

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

Pseudocode

A

cross between human language and a programming language
Ex
Get payroll data.
Calculate gross pay.
Display gross pay.
(provide more details even, Display: How many hours worked?
etc

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

Logical errors

A

mistakes that cause the program to produce erroneous results (trace through to see the logic of each step in a hierarchy or pseudocode)

17
Q

desk-checking

A

programmer reads through program (or a portion) and steps through each statement. A sheet of paper is often used to jot down current contents of all variables and sketch what the screen looks like after each output operation; stepping through can catch many errors

18
Q

Compiler

A

translates each source code statement into the appropriate machine language statements; finds syntax errors

19
Q

Main Memory

A

RAM
Working Memory
Temporary
Memory the computer uses while it’s running a program

20
Q

Secondary Memory

A

Permanent Memory

21
Q

All programs must be loaded into ____ memory before they can be executed

A

All programs must be loaded into MAIN memory before they can be executed.

22
Q

Why is Main Memory (RAM) considered “Volatile”?

A

Because it is erased when the computer is turned off or when the program terminates.

23
Q

What type of software controls the internal operations of the computer’s hardware?

A

Operating System

24
Q

Computers can do many different jobs because they can be _______.

A

programmed

25
Q

The job of the ______ is to fetch instructions, carry out the operations commanded by the instructions, and produce some outcome or resultant information.

A

CPU

26
Q

Internally, the CPU consists of the ____ and the ____.

A

Control Unit and ALU (arithmetic and logic unit)

27
Q

Arithmetic and Logic Unit (of CPU)

A

performs the math operations

28
Q

Control Unit (of CPU)

A

Coordinates all of the computer’s operations

29
Q

A ______ is an example of a secondary storage device.

A

Disk

30
Q

The two general categories of software are _____ and _____.

A

System software and Application software.

31
Q

Words or names defined by the programmer are called …

A

Programmer defined identifiers

32
Q

A ________ is a named storage location

A

variable

33
Q

You can force an integer to be stored as a long integer by placing the letter __ at the _____ of the number.

A
L at the end. 
Example: 
int amount;
amount = 32L; 
Literal is treated as a long.
34
Q

On any computer, which data type uses more memory, an integer or an unsigned integer?

A

They use the same amount of memory.

35
Q

Is there an unsigned floating-point data type? If yes, what is it?

A

No.

36
Q

How would the followin number in scientific notation be representing in E notation?
6.31 x 10 (to the 17th)

A

6.31E17