M01 Flashcards

1
Q

The basic commands that a computer performs are input, output, storage, and performance of arithmetic and logical operations.

A

True

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

Main memory is directly connected to the CPU.

A

True

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

When the computer is turned off, everything in secondary memory is lost.

A

False

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

The devices that feed data and programs into computers are called output devices.

A

False

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

Information stored in main memory must be transfered to some other device for permanent storage.

A

True

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

The device that stores information permanently (unless the device becomes unusable or you change the information by rewriting it) is called primary storage.

A

False

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

The command that does the linking on Visuall C++ 2010 Express and Visual Studio 2010 is Make or Remake.

A

False

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

When you compile your program, the compiler identifies the logic errors and suggests how to correct them.

A

False

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

To develop a program to solve a problem, you start by analyzing the problem.

A

True

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

C++ programs have always been portable from one compiler to another.

A

False

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

Several categories of computers exist, such as ____.

A

mainframe, midsize, and micro

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

The basic commands that a computer performs are ___, and performance of arithmetic and logical operations.

A

input, output, storage

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

Main memory is called ____.

A

random access memory

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

The ___ is the brain of the computer and the single most expensive peice of harware in your personal computer.

A

CPU

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

Main memory is an ordered sequence of items, called ___.

A

memory cells

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

The devices that feed data and programs into computers are called ___ devices.

A

input

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

The devices that the computer uses to display results are called ___ devices.

A

output

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

When the power is switched off, everything in ___ is lost.

A

main memory

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

___ progrmas perform a specific task.

A

Application

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

___ represent information with a sequence of 0s and 1s.

A

Digital signals

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

In C++ reserved words are the same as predefined identifiers.

A

False

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

The maximum number of significant digits in values of the double type is 15.

A

True

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

The maximum number of significant digits in float values is up to 6 or 7.

A

True

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

An operator that has only one operand is called a unique operator.

A

False

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

If a C++ arithmetic expression has no parentheses, operators are evaluated from left to right.

A

True

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

A mixed arithmetic expression contains all operands of the same type.

A

False

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

Suppose a = 5. After the execution of the statement ++a; the value of a is 6.

A

True

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

The escape sequence /r moves the insertion point to the beginning of the next line.

A

True

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

A comma is also called a statement terminator.

A

False

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

Suppose that sum is an int variable. The statement sum += 7; is equivalent to the statement sum = sum + 7.

A

True

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

The ___ rules of programming language tell you which statements are legal, or accepted by the programming language.

A

syntax

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

Is a reserved word in C++

A

char

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

___ is a valid char value.

A

‘A’

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

An example of a floating point data type is ____.

A

double

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

The memory allocated for a float value is ___ bytes.

A

four

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

The value of the expression 33/10, assuming both values are integral data types is ____.

A

3

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

The value of the expression 17 % 7 is ____.

A

3

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

The expression static_cast

A

9

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

A sequence of eight bits is called a ____.

A

byte

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

The digit 0 or 1 is called a binary digit or ____.

A

bit

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

The term GB refers to ___.

A

gigabyte

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

___ consists of 65,536 characters.

A

Unicode

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

A program called a ____ translates instructions written in high-level languages into machine code.

A

compiler

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

A program called a ___ combines the object program with the programs from libraries.

A

linker

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

A program that loads an executable program into main memory is called a ___.

A

loader

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

A step-by-step problem-solving process in which a solution is arrived at in a finite amount of time is caled an ____.

A

algorithm

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

To develop a program to solve a problem, you start by ____.

A

analyzing the problem

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

Dividing a problem into smaller subproblems is called ___ design.

A

structured

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

An ___ consists of data and the operations on those data.

A

object

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

The programming language C++ evolved from ____.

A

C

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

The programming language C++ was designed by Bjarne Stroustrup at Bell Laboratories in the early ____.

A

1980s

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

The ____ monitors the overall activity of the computer and provides services such as memory management, input/output activities, and storage management.

A

operating system

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

___ signals represent information with a sequence of 0s and 1s.

A

Digital

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

Word processors, spreadsheets, and games are examples of ____.

A

applications

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

A sequence of 0s and 1s is sometimes referred to as ____ code.

A

binary

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

The ASCII data set consists of ___ characters.

A

128

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

Assemble language uses easy-to-remember instructions called ____.

A

mnemonic

58
Q

A program called an _____ translates the assembly language instructions into machine language.

A

assembler

59
Q

___ languages include FORTRAN, COBOL, Pascal, C, C++, and Java.

A

High-level

60
Q

The term ___ is used to describe a program that has been written in a high-level language.

A

source program

61
Q

In a C++ program, statements that begin with the symbol # are called ____ directives.

A

preprocessor

62
Q

The machine language verson of the high-level language program is called ____.

A

object program

63
Q

The structured design approach is also known as ____.

A

top-down design

64
Q

In object-oriented design, the first step in the problem-solving process is to identify the components called ___, which form the basis of a solution, and to determine how they interact with one another.

A

objects

65
Q

In ___ design, the final program is a collection of interacting objects.

A

object oriented

66
Q

In C++, the mechanism that allows you to combine data and operationso f the data into a single unit is called a ____.

A

class

67
Q

In C++, reserved words are the same as predefined identifiers.

A

False

68
Q

The escape sequence \r moves the insertion point to the beginning of the next line.

A

False

69
Q

The expression static_cast(6.9) + static_cast(7.9) evaluates to ____.

A

13

70
Q

In a C++ program, one and two are double variables and input values are 10.5 and 30.6. After the statement cin&raquo_space; one&raquo_space; two; executes, ____.

A

one = 10.5, two = 30.6

71
Q

Suppose that count is an int variable and count = 1. After the statement count++; executes, the value of count is ____.

A

2

72
Q

Suppose that alpha and beta are int variables. The statement alpha = –beta; is equivalent to the statement(s) ____.

A
beta = beta - 1;
alpha = beta;
73
Q

Suppose that alpha and beta are int variables. The statement alpha = beta++; is equivalent to the statement(s) ____.

A
alpha = beta;
beta = beta + 1;
74
Q

Suppose that alpha and beta are int variables. The statement alpha = ++beta; is equivalent to the statement(s) ____.

A
beta = beta + 1;
alpha = beta;
75
Q

Choose the output of the following C++ statement:

cout

A

Sunny

Day

76
Q

Which of the following is the new line character?

A

\n

77
Q

Consider the following code.

// Insertion Point 1

using namespace std;
const float PI = 3.14;

int main()
{
//Insertion Point 2

float r = 2.0;
float area;
area = PI r r;

cout

A

insertion point 1

78
Q

____ are executable statements that inform the user what to do.

A

prompt lines

79
Q

The declaration int a, b, c; is equivalent to which of the following?

A

int a,b,c;

80
Q

Suppose that alpha and beta are int variables and alpha = 5 and beta = 10. After the statement alpha *= beta; executes, ____.

A

alpha = 50

81
Q

Suppose that sum and num are int variables and sum = 5 and num = 10. After the statement sum += num executes, ____.

A

sum = 15

82
Q

When reading data into a char variable, after skipping any leading whitespace characters, the extraction operator&raquo_space; finds and stores only the next character; reading stops after a single character.

A

True

83
Q

If input failure occurs in a C++ program, the program terminates immediately and displays an error message.

A

False

84
Q

In an output statement, each occurrence of endl advances the cursor to the end of the current line on an output device.

A

False

85
Q

You can use the function getline to read a string containing blanks.

A

True

86
Q

Suppose that x and y are int variables. Which of the following is a valid input statement?

A

cin&raquo_space; x&raquo_space; y;

87
Q

Suppose that alpha is an int variable and ch is a char variable and the input is:

17 A

What are the values after the following statements execute?

cin&raquo_space; alpha;
cin&raquo_space; ch;

A

alpha = 17, ch = ‘A’

88
Q

Suppose that x is an int variable, y is a double variable, z is an int variable, and the input is:

15 76.3 14

Choose the values after the following statement executes:

cin&raquo_space; x&raquo_space; y&raquo_space; z;

A

x = 15, y = 76.3, z = 14

89
Q

Suppose that x and y are int variables, z is a double variable, and the input is:

28 32.6 12

Choose the values of x, y, and z after the following statement executes:

cin&raquo_space; x&raquo_space; y&raquo_space; z;

A

x = 28, y = 32, z = 0.6

90
Q

Suppose that x and y are int variables, ch is a char variable, and the input is:

4 2 A 12

Choose the values of x, y, and ch after the following statement executes:

cin&raquo_space; x&raquo_space; ch&raquo_space; y;

A

This statement results in input failure

91
Q

Suppose that ch1 and ch2 are char variables, alpha is an int variable, and the input is:

A 18

What are the values after the following statement executes?

cin.get(ch1);
cin.get(ch2);
cin&raquo_space; alpha;

A

ch1 = ‘A’, ch2 = ‘ ‘, alpha = 18

92
Q

Suppose that ch1, ch2, and ch3 are variables of the type char and the input is:

A B
C

What is the value of ch3 after the following statements execute?

cin. get(ch1);
cin. get(ch2);
cin. get(ch3);

A

‘B’

93
Q

When you want to process only partial data, you can use the stream function ____ to discard a portion of the input.

A

ignore

94
Q

Suppose that alpha, beta, and gamma are int variables and the input is:

100 110 120
200 210 220
300 310 320

What is the value of gamma after the following statements execute?

cin >> alpha;
cin.ignore(100, '\n');
cin >> beta;
cin.ignore(100,'\n');
cin >> gamma;
A

300

95
Q

Suppose that ch1 and ch2 are char variables and the input is:

WXYZ

What is the value of ch2 after the following statements execute?

cin.get(ch1);
cin.putback(ch1);
cin&raquo_space; ch2;

A

W

96
Q

Suppose that ch1 and ch2 are char variables and the input is:

WXYZ

What is the value of ch2 after the following statements execute?

cin&raquo_space; ch1;
ch2 = cin.peek();
cin&raquo_space; ch2;

A

X

97
Q

In C++, the dot is an operator called the ____ operator.

A

member access

98
Q

____ is a parameterized stream manipulator.

A

setfill

99
Q

Manipulators without parameters are part of the ____ header file.

A

iostream

100
Q
Which of the following is an int value?
46259
-32.00
46,259
462.59
A

46259

101
Q

A … can be helpful for all phases of the software development process

A

walk through

102
Q
Which of the following is a legal identifer
program_1
program 1
1program
program!
A

program_1

103
Q

Consider the following program segment.
ifstream inFile; //Line 1
int x, y; //Line 2

… //Line 3

inFile&raquo_space; x&raquo_space; y; //Line 4

A

inFile.open(“progdata.dat”);

104
Q

… are aspects of programs that cause the programs to do other than what you intended

A

bugs

105
Q

In C++, you use a … to instruct a program to mark those memory locations in which data is fixed throughout program execution.

A

named constant

106
Q

What does a reserved word have to start with?

A

a lowercase

107
Q

Suppose that alpha and beta are int variables. The statement alpha = beta–; is equivalent to the statement(s) ____.

A
alpha = beta; 
beta = beta - 1;
108
Q

The expression static_cast(9.9) evaluates to…

A

9

109
Q

To turn your Java source code into bytecode for the JVM, (from the command-line) you use:

A

the javac compiler

110
Q

Which phase of the fetch-decode-execute cycle might use a circuit in the arithmetic-logic unit?

A

execute

111
Q

The early high-level programming language designed around the notation of Lambda Calculus and used to develop early artificial intelligence programs was named ___________________.

A

LISP

112
Q

When you create a Java program, using your text editor, your program will have the extension:

A

.java

113
Q

Here is a portion of the source code for a computer program:

69 6D 70 6F 72 74 20 6A-61 76 61 2E 61 77 74 2E
2A 3B 0D 0A 69 6D 70 6F-72 74 20 6A 61 76 61 2E
61 77 74 2E 65 76 65 6E-74 2E 2A 3B 0D 0A 69 6D

This program is an example of _____________________________.

A

machine language

114
Q

If your Java source code program compiles, but displays an error message when you run it, then it must have a:

A

runtime error

115
Q

Each memory cell has a unique location in main memory, called the ____.

A

address

116
Q

The source program is written in ____.

A

a high-level language

117
Q

Which of these identifiers follows the Java conventions (not just the syntax rules) for a constant name?

A

TOTAL_COST

118
Q

Which of these words that can appear in a Java program are reserved or keywords?

A

class

119
Q

In a method definition, the word public is called:

A

the access specifier

120
Q

The method in the PrintStream class that displays a line of output on the console, and that does not advance the printing “cursor” to the next line is named:

A

print

121
Q

When “sending a message” to an object, the method that you want to call is called:

A

the request

122
Q

What characters may appear when writing a literal of type double:

A

All of these may appear in a double literal.

123
Q

Instance variables:

A

are automatically initialized

124
Q

A local variable:

A

can only be used inside the method where it is defined.

125
Q

To change the default foreground or background color of your applet, you’ll normally use the _____________ method

A

init();

126
Q

Object variables contain ________________.

A

object references

127
Q

Suppose x = 2 and y = 3. If the statement

x *= y;

is executed once, what is the value of y?

A

3

128
Q

Evaluate the following expression. Make sure that your answer is the correct type:

2 is an int
2.0 is a double

Math.sqrt(64)

A

8.0

129
Q

Two-way selection in Java is implemented using ____.

A

if…else statements

130
Q

Which of these relational expressions is incorrect [assume x is an int] :

A

x 3

131
Q

A boolean variable can hold the values :

A

true and false

132
Q

Font size is specified in points. A one-inch font would be ___________ points.

A

72

133
Q

When using the Graphics fillRect() method, a rectangle passed a width of 100 will actually be drawn:

A

100 pixels wide

134
Q

The conditional operator ?: takes _____ arguments.

A

3

135
Q

int x = 6, y;

if (x > 5)
y = 1;
else if (x
A

1

136
Q

Which of these statements does not describe a typical ACM GraphicsProgram?

A

consists of sequential input, output and processing steps

137
Q
Given the nested if-else structure below:
if (a > 0)
if (b  5)
x = x + 4;
else
x = x + 3;
else
x = x + 2;
If x is currently 0, a = 1 and b = -1, what will x become after the above statement is executed?
A

5

138
Q

Suppose that outFile is an ofstream variable and output is to be stored in the file outputData.out. Which of the following statements opens the file outputData.out and associates outFile to the output file?

A

outFile.open(“outputData.out”)

140
Q
The code shown here: new Color(0, 255, 0)
constructs an object with the color \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_.
A

green

141
Q

What is the result of evaluating the expression below? Your answer must be the correct type:
· 2 is an int
· 2.0 is a double
· “2” is a String (remember the quotes)

A

“2 + 2 “ + (3 + 4) “2 + 2 7”