Question: 1) For the following C++ code: true && false && true; What is the *type* of the C++ expression? a) false b) true c) bool
1) For the following C++ code:
true && false && true;
What is the *type* of the C++ expression?
a) false
b) true
c) bool
d) 0
e) int
2) For the following C++ code:
true && false && true;
What value will the C++ expression have when evaluated by the computer?
a) We can not know
b) true
c) 4
d) 0
e) int
5) For the following C++ code:
rand() + pow(rand(), 2);
What is the *type* of the C++ expression?
a) We can't know
b) true
c) bool
d) 0
e) int
6) For the following C++ code:
rand() + pow(rand(), 2);
What value will the C++ expression have when evaluated by the computer?
a) We can not know
b) true
c) 4
d) 0
e) int
7) Which of the following isn't a type provided by C++?
a) pokemon
b) char*
c) int
d) decimal
e) a & d
8) What output will the following program produce?
include
using namespace std;
int main(){
if(false && true && true && 5==5){
cout << 1 << endl;
}else{
cout << 0 << endl;
}
}
1
0
9) What output will the following program produce?
include
using namespace std;
int main(){
if(!(2*2*3==4)){
cout << 1 << endl;
}else{
cout << 0 << endl;
}
}
1
0
10) An if statement:
a)is used to do something many times
b)is a way to decide what to do based on some condition
c)isn't needed if you use recursion.
d)can't be passed to a function as an argument
e)b&d
11) For the following C++ code:
int foo;
What kind of C++ expression is this?
a) variable
b) assignment
c) number
d) variable declaration
e) a pointer to int
12) For the following C++ code:
foo = 3;
What kind of C++ expression is this?
a) int
b) assignment
c) number
d) variable declaration
e) a pointer to int
13) For the following C++ code:
int foo = 5;
int bar = 6;
int a = bar;
bar = 9 + foo;
int b = a + foo;
a + 6;
b + a + bar;
What value will the variable 'a' hold after all these lines are evaluated?
a) we can't know
b) 10
c) 14
d) 12
e) 6
14) For the following C++ code:
int foo = 5;
cout << foo << endl;
foo = 6;
cout << foo << endl;
foo = 5;
cout << foo << endl;
What value will the variable 'foo' hold after all these lines are evaluated?
a)5
b)6
c)5 6 5
d)we can't know
e)6 5 6
15) For the following C++ code:
int foo = 5;
int bar;
int a = bar;
bar = 9 + foo;
int b = a + foo;
a + 6;
b + a + bar;
What value will the variable 'a' hold after all these lines are evaluated?
a)we can't know
b)20
c)14
d)12
e)6
27) You can write programs that never end using if statements.
t
f
28) You cna write programs that never end using functions.
t
f
29) You can write programs that never end using loops.
t
f
30) Computer memory is made up of literal zeros and ones.
t
f
31) There are a theoretically finite number of computer programs.
t
f
32) There is exectly one way to express any computational idea.
t
f
33) Human can express computation in machine-code.
t
f
34) A while loop whose condition never becomes false is an infinite loop.
t
f
48) All function is a program have access to all variables in the main function.
string function(string a) int main() (int b;)
t
f
49) When calling a function, you must pass it values using the variable names expected by
t
f
50) A function may always return one of its input arguments.
t
f
51) A function always converts a value of its input type to a different output type.
t
f
52) A void function shouldn't return
t
f
57) Computer can store any number.
t
f
58) Computer can't store most numbers.
t
f
59) What limits the number of elements that can be stored in an array:
a) The amount of physical memory available to the program
b) Nothing
c) How many times the [] syntax is used in a program.
d) The compiler
e) The limitaion of float
60) An array is a linked list.
t
f
61) You can access memory locations *past* the end of an array.
t
f
62) Adjacent values in an array are also adjacent in RAM.
t
f
63) Functions that accept arrays as input should also have a parameter for the array length.
t
f
64) Function are able to change the contents of an array.
t
f
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
