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
If a C++ arithmetic expression has no parentheses, operators are evaluated from left to right.
True
26
A mixed arithmetic expression contains all operands of the same type.
False
27
Suppose a = 5. After the execution of the statement ++a; the value of a is 6.
True
28
The escape sequence /r moves the insertion point to the beginning of the next line.
True
29
A comma is also called a statement terminator.
False
30
Suppose that sum is an int variable. The statement sum += 7; is equivalent to the statement sum = sum + 7.
True
31
The ___ rules of programming language tell you which statements are legal, or accepted by the programming language.
syntax
32
Is a reserved word in C++
char
33
___ is a valid char value.
'A'
34
An example of a floating point data type is ____.
double
35
The memory allocated for a float value is ___ bytes.
four
36
The value of the expression 33/10, assuming both values are integral data types is ____.
3
37
The value of the expression 17 % 7 is ____.
3
38
The expression static_cast
9
39
A sequence of eight bits is called a ____.
byte
40
The digit 0 or 1 is called a binary digit or ____.
bit
41
The term GB refers to ___.
gigabyte
42
___ consists of 65,536 characters.
Unicode
43
A program called a ____ translates instructions written in high-level languages into machine code.
compiler
44
A program called a ___ combines the object program with the programs from libraries.
linker
45
A program that loads an executable program into main memory is called a ___.
loader
46
A step-by-step problem-solving process in which a solution is arrived at in a finite amount of time is caled an ____.
algorithm
47
To develop a program to solve a problem, you start by ____.
analyzing the problem
48
Dividing a problem into smaller subproblems is called ___ design.
structured
49
An ___ consists of data and the operations on those data.
object
50
The programming language C++ evolved from ____.
C
51
The programming language C++ was designed by Bjarne Stroustrup at Bell Laboratories in the early ____.
1980s
52
The ____ monitors the overall activity of the computer and provides services such as memory management, input/output activities, and storage management.
operating system
53
___ signals represent information with a sequence of 0s and 1s.
Digital
54
Word processors, spreadsheets, and games are examples of ____.
applications
55
A sequence of 0s and 1s is sometimes referred to as ____ code.
binary
56
The ASCII data set consists of ___ characters.
128
57
Assemble language uses easy-to-remember instructions called ____.
mnemonic
58
A program called an _____ translates the assembly language instructions into machine language.
assembler
59
___ languages include FORTRAN, COBOL, Pascal, C, C++, and Java.
High-level
60
The term ___ is used to describe a program that has been written in a high-level language.
source program
61
In a C++ program, statements that begin with the symbol # are called ____ directives.
preprocessor
62
The machine language verson of the high-level language program is called ____.
object program
63
The structured design approach is also known as ____.
top-down design
64
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.
objects
65
In ___ design, the final program is a collection of interacting objects.
object oriented
66
In C++, the mechanism that allows you to combine data and operationso f the data into a single unit is called a ____.
class
67
In C++, reserved words are the same as predefined identifiers.
False
68
The escape sequence \r moves the insertion point to the beginning of the next line.
False
69
The expression static_cast(6.9) + static_cast(7.9) evaluates to ____.
13
70
In a C++ program, one and two are double variables and input values are 10.5 and 30.6. After the statement cin >> one >> two; executes, ____.
one = 10.5, two = 30.6
71
Suppose that count is an int variable and count = 1. After the statement count++; executes, the value of count is ____.
2
72
Suppose that alpha and beta are int variables. The statement alpha = --beta; is equivalent to the statement(s) ____.
``` beta = beta - 1; alpha = beta; ```
73
Suppose that alpha and beta are int variables. The statement alpha = beta++; is equivalent to the statement(s) ____.
``` alpha = beta; beta = beta + 1; ```
74
Suppose that alpha and beta are int variables. The statement alpha = ++beta; is equivalent to the statement(s) ____.
``` beta = beta + 1; alpha = beta; ```
75
Choose the output of the following C++ statement: | cout
Sunny | Day
76
Which of the following is the new line character?
\n
77
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
insertion point 1
78
____ are executable statements that inform the user what to do.
prompt lines
79
The declaration int a, b, c; is equivalent to which of the following?
int a,b,c;
80
Suppose that alpha and beta are int variables and alpha = 5 and beta = 10. After the statement alpha *= beta; executes, ____.
alpha = 50
81
Suppose that sum and num are int variables and sum = 5 and num = 10. After the statement sum += num executes, ____.
sum = 15
82
When reading data into a char variable, after skipping any leading whitespace characters, the extraction operator >> finds and stores only the next character; reading stops after a single character.
True
83
If input failure occurs in a C++ program, the program terminates immediately and displays an error message.
False
84
In an output statement, each occurrence of endl advances the cursor to the end of the current line on an output device.
False
85
You can use the function getline to read a string containing blanks.
True
86
Suppose that x and y are int variables. Which of the following is a valid input statement?
cin >> x >> y;
87
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 >> alpha; cin >> ch;
alpha = 17, ch = 'A'
88
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 >> x >> y >> z;
x = 15, y = 76.3, z = 14
89
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 >> x >> y >> z;
x = 28, y = 32, z = 0.6
90
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 >> x >> ch >> y;
This statement results in input failure
91
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 >> alpha;
ch1 = 'A', ch2 = ' ', alpha = 18
92
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);
'B'
93
When you want to process only partial data, you can use the stream function ____ to discard a portion of the input.
ignore
94
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; ```
300
95
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 >> ch2;
W
96
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 >> ch1; ch2 = cin.peek(); cin >> ch2;
X
97
In C++, the dot is an operator called the ____ operator.
member access
98
____ is a parameterized stream manipulator.
setfill
99
Manipulators without parameters are part of the ____ header file.
iostream
100
``` Which of the following is an int value? 46259 -32.00 46,259 462.59 ```
46259
101
A ... can be helpful for all phases of the software development process
walk through
102
``` Which of the following is a legal identifer program_1 program 1 1program program! ```
program_1
103
Consider the following program segment. ifstream inFile; //Line 1 int x, y; //Line 2 ... //Line 3 inFile >> x >> y; //Line 4
inFile.open("progdata.dat");
104
... are aspects of programs that cause the programs to do other than what you intended
bugs
105
In C++, you use a ... to instruct a program to mark those memory locations in which data is fixed throughout program execution.
named constant
106
What does a reserved word have to start with?
a lowercase
107
Suppose that alpha and beta are int variables. The statement alpha = beta--; is equivalent to the statement(s) ____.
``` alpha = beta; beta = beta - 1; ```
108
The expression static_cast(9.9) evaluates to...
9
109
To turn your Java source code into bytecode for the JVM, (from the command-line) you use:
the javac compiler
110
Which phase of the fetch-decode-execute cycle might use a circuit in the arithmetic-logic unit?
execute
111
The early high-level programming language designed around the notation of Lambda Calculus and used to develop early artificial intelligence programs was named ___________________.
LISP
112
When you create a Java program, using your text editor, your program will have the extension:
.java
113
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 _____________________________.
machine language
114
If your Java source code program compiles, but displays an error message when you run it, then it must have a:
runtime error
115
Each memory cell has a unique location in main memory, called the ____.
address
116
The source program is written in ____.
a high-level language
117
Which of these identifiers follows the Java conventions (not just the syntax rules) for a constant name?
TOTAL_COST
118
Which of these words that can appear in a Java program are reserved or keywords?
class
119
In a method definition, the word public is called:
the access specifier
120
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:
print
121
When "sending a message" to an object, the method that you want to call is called:
the request
122
What characters may appear when writing a literal of type double:
All of these may appear in a double literal.
123
Instance variables:
are automatically initialized
124
A local variable:
can only be used inside the method where it is defined.
125
To change the default foreground or background color of your applet, you'll normally use the _____________ method
init();
126
Object variables contain ________________.
object references
127
Suppose x = 2 and y = 3. If the statement x *= y; is executed once, what is the value of y?
3
128
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)
8.0
129
Two-way selection in Java is implemented using ____.
if...else statements
130
Which of these relational expressions is incorrect [assume x is an int] :
x 3
131
A boolean variable can hold the values :
true and false
132
Font size is specified in points. A one-inch font would be ___________ points.
72
133
When using the Graphics fillRect() method, a rectangle passed a width of 100 will actually be drawn:
100 pixels wide
134
The conditional operator ?: takes _____ arguments.
3
135
int x = 6, y; ``` if (x > 5) y = 1; else if (x ```
1
136
Which of these statements does not describe a typical ACM GraphicsProgram?
consists of sequential input, output and processing steps
137
``` 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? ```
5
138
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?
outFile.open("outputData.out")
140
``` The code shown here: new Color(0, 255, 0) constructs an object with the color _________________. ```
green
141
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)
"2 + 2 " + (3 + 4) "2 + 2 7"