C++ Review Questions fill in the blank. Please answer all to the best of your ab
ID: 3829916 • Letter: C
Question
C++ Review Questions fill in the blank. Please answer all to the best of your ability! Thank you!
1.) What will the following statement do if x equals 17 and answer = 20?
answer = x > 100 ? 0 : 1;
2.) In the C++ statement
pay = rate * hours;
the * symbol is an example of
3.) Three primary activities of a typical program are
4.) A static local variable is one
5.) To determine that a item is not in an unordered array of 100 items, linear search must
examine an average of ________ values.
6.) What value will be assigned to the variable number by the following statement?
int number = 7.8;
7.) To use stream manipulators, you should include the ________ header file.
8.) A variable definition always specifies the name of a variable and tells
9.) A(n) ________ is a special value that marks the end of a list of values.
10.) To locate a value in an ordered array of 50 items, binary search must examine at
most ________ values.
Explanation / Answer
1.) What will the following statement do if x equals 17 and answer = 20?
answer = x > 100 ? 0 : 1;
Ans: it set answer to 1 because x < 100, so 1 will be assigned to answer.
2.) In the C++ statement
pay = rate * hours;
the * symbol is an example of
Ans: multiplication
3.) Three primary activities of a typical program are input, processing, and output
4.) A static local variable is one declared as static inside a function
5.) To determine that a item is not in an unordered array of 100 items, linear search must
examine an average of 100 values.
6.) What value will be assigned to the variable number by the following statement?
int number = 7.8;
Ans: 7
7.) To use stream manipulators, you should include the iostream header file.
8.) A variable definition always specifies the name of a variable and tells what type of data it can hold.
9.) A(n) sentinel is a special value that marks the end of a list of values.
10.) To locate a value in an ordered array of 50 items, binary search must examine at
most log2(50) (base is 2) values.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.