stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
C++ Review Flashcards | StudBud
Explore
/
C++ Review
C++ Review
30 terms
·
StudBud Administration
·
24 plays
A #c++ programming quiz to review important concepts.
Flashcards
30 cards
F
Practice quiz
P
Host live
L
Questions
30
Answers
1
The variable names in the parentheses of a called function are ___________________
arguments
prototypes
specifications
data types
2
To generate a random number between 5 and 20 use:
rand( ) % 15
rand(5, 20);
5 + rand( ) % 16
20 + rand( ) % 5
3
To set the width of carpet to 50 use:
carpet = 50;
width = 50;
Rectangle.width = 50;
carpet.width = 50;
4
In a switch statement, we must utilize the keyword ______ to prevent other cases from executing
case
break
stop
continue
5
What is the output?
40
35
25
30
6
In a flowchart, which symbol is used for OUTPUT?
Diamond
Circle
Parallelogram
Rectangle
7
A function returning a value must specify the ____ of the value that will be returned.
size
variable
address
data type
8
If a loop does not contain within itself a way to terminate, it is called
do while loop
infinite loop
while loop
for loop
9
In C++, 5 / 2 results in:
2.5
2
0
0.5
10
What is the header for the function sum: which adds two integers together?
float sum(int, int)
int sum(float, int)
float sum(float, float)
int sum(int, int)
11
To input a person's entire name, use:
cin >> name;
name << cin;
getline(cin, name);
getline(name, cin);
12
What is the output?
Overload! 12
12 Overload!
Overload! 6
6 Overload!
13
What is the output of the following program?
20
0.25
5
4
14
What is the output?
24 13
8 14
37 16
infinite loop
15
What is the output?
6, 4
3, 4
6, 5
3, 5
16
What is the name of your CIS 160 professor?
Atshan
Rodrigues
Manczur
Rodriguez
17
What is the output?
20
10
30
40
18
!(5 <= 2.6) evaluates to
True
False
19
In C++ 5.0 / 2 evaluates to:
2
0.5
2.5
0
20
Symbolic names made up by the programmer that represents locations in RAM are:
compilation errors
keywords
syntax
variables
21
Which of the following expressions is equivalent to x <= y
! (x >= y)
! (x > y)
! (x <= y)
x > y
22
Which of the following declares an array that can hold 123 integers?
int numbers[ ];
int[ ] = numbers(123)
int numbers[ ] = 123;
int numbers[123];
23
Assume data type can hold values 0 through 9. What is 9 + 3?
2
3
0
12
24
What is the output?
11
12
2
0
25
What is the output
5
6
0
2
26
Which of the following is FALSE about low-level programming languages?
Can be written in binary
Communicates directly with hardware
C++ is a low-level language
Can be written in machine code
27
In an if- else statement, if the boolean expression is false
the if block is executed
nothing is executed
all blocks are excuted
the else block is executed
28
What is the output?
7 9
2 5
0 4
7 6
29
What is the output?
6
2
0
5
30
Which statement correctly inputs into the variable userInput?
cin >> userInput;
userInput << cin;
cin << userInput;
userInput >> cin;