C++ Exam
Which operator do you use to test for inequality in C++?
!=
Find the value of the expression: 12 % 3 * 6 - 7
-7
Using scientific notation, the number 1,225,000.00, would be displayed as ____.
1.225e+006
If you use the floating-point number 3.7 to initialize a memory location that can store only integers, the computer converts it to ____.
3
What is the next Fibonacci number in the following sequence? 1, 1, 2, 3, 5, 8, 13, 21, ...
34
Find the value of the expression: 8 - 7 / 3
6
Which operator do you use to test for equality in C++?
==
Which of the following statement(s) is/are true? A) The CPU is the Central Processing Unit. B) The ALU is the Arithmetic-Logic Unit. C) RAM is Random Access Memory. D) All of the above are true.
D
Which of the following is the main function of the CU?
Fetch and decode the instructions
All computer programs, no matter how simple or how complex, are written using one or more of three basic control structures. What are they?
Sequence, selection, and repetition
A set of instructions that tells a computer exactly what to do is called ____.
a program
An algorithm is ____.
a set of step-by-step instructions that transforms the problem's input into its output
A logical, step-by-step procedure that, if followed correctly, will eventually solve a specific problem.
algorithm
A(n) ____ is simply the set of step-by-step instructions that accomplish a task.
algorithm
The first step in solving a familiar problem is to ____ the problem.
analyze
the part of the CPU that performs arithmetic computations and logical operations.
arithmetic logic unit (ALU)
A program that takes as input a program written in assembly language and translates it into machine code or machine language
assembler
A programming language that uses letters and numbers to represent machine language instructions
assembly language
When a(n) ____ statement is encountered in a program, the computer gives the value of the expression appearing on the right side to the variable whose variable name appears on the left side.
assignment
If E1 is true, and E2 is false, then which of the following Boolean expressions is true? a. E1 && E2 b. E1 || E2 c. ! (E1 || E2) d. ! (E1) && E2
b
Which is not a high-level language? a. Java b. assembly c. COBOL d. Pascal
b
Which of the following statements regarding identifiers in a C++ program is false? a. The identifier must begin with a letter or an underscore b. The identifier must contain only letters and underscores c. The identifier cannot be a keyword d. Identifiers in C++ are case sensitive
b
computer language in 0s and 1s
binary
You create a statement block by enclosing the statements in a set of ____.
braces {}
Which of the following is not a C++ keyword? a. char b. false c. after d. bool
c
combination of the control unit and the ALU; the "brains" of the computer
central processing unit (CPU)
A correct statement to get values for the variables A, B, and C would be:
cin >>A >> B >> C;
a computer program (or set of programs) that transforms source code written in a programming language (the source language) into a high-level language
complier
Which of these is not a reserved word in C++? a. default b. protected c. void d. foreach
d
____ refers to the process of locating and removing any errors in a program.
debugging
____ is a C++ manipulator that advances the cursor to the next line on the screen.
endl
You can create a comment by typing two ____ before the text you want treated as a comment.
forward slashes (//)
If you do not supply an initial value for a variable in a C++ program, the variable may contain a meaningless value, referred to by programmers as "____".
garbage
the physical parts of the system that have mass and can actually be touched
hardware
You should assign a descriptive name to each variable and named constant used in a program. The name, also called the ____, should help you remember the purpose of the memory location.
identifier
When the loop condition evaluates to false, the loop instructions are skipped over and processing continues with the instructions ____.
immediately following the end of the loop
When a program instructs the computer to initialize a memory location, the computer first compares the data type of the value assigned to the memory location with the data type of the memory location itself to verify that the value is appropriate for the memory location. If the value's data type does not match the memory location's data type, the computer uses a process called ____ type conversion to convert the value to fit the memory location.
implicit
In a for loop, which of the following is executed first?
initial statement
Assigning a beginning value to a memory location is referred to as ____.
initializing
The ____ combines the object file with other machine code necessary for your C++ program to run correctly.
linker
Preparation to execute the object program involves ____ other machine language statements to the object program and then ____ the program into memory
linking/loading
Programmers use the repetition structure, referred to as a ____, when they need the computer to repeatedly process one or more program instructions until some condition is met, at which time the repetition structure ends
loop
The ____ arithmetic operator is used to divide two integers, and results in the remainder of the division.
modulus (%)
Machine code equivalent of a high level language code is usually called ____.
object code
the result of compiler operations on the source code
object code
The instructions contained in a posttest loop always are processed at least ____.
once
a convenient and efficient interface between the user and the hardware
operating system
Programmers refer to the goal as the ____, and the items needed to achieve the goal as the ____.
output, input
In a ____ loop, the word while ____ the loop.
pretest, appears at the beginning
A coded algorithm is called a ____.
program
A do while statement ends with a ____.
semicolon
The three arguments in a for clause are separated by two ___.
semicolons (;)
The ____ structure directs the computer to process the program instructions, one after another, in the order listed in the program.
sequence
operations specified with a set of instructions; programs and other operating information used by a computer
software
the set of instructions in a computer language that solve a specific problem
source code
The comparison operator "<" has ____ the comparison operator "<="
the same precedence number as
A posttest loop begins with ____.
the word do