I need some with these questions urgently!!! CSC 134 Programming Language Questi
ID: 3643017 • Letter: I
Question
I need some with these questions urgently!!!CSC 134 Programming Language
Question 1
1) If a variable is declared in the initialization expression of a for statement, then:
a)It is automatically reinitialized to zero once the loop is finished.
b) The scope of the variable is restricted to that for loop.
c ) It retains its final value after the loop is finished.
d) It can not be used in any structures that are nested in that for structure.
Question 2
All of the following are reasons to use recursion except:
Answer An iterative solution is not apparent.
The resulting program is easier to debug.
It more naturally mirrors the problem.
It maximizes execution performance.
Question 3
Using ______ _______ values for counters in counter-controlled repetition
Question 4
Keywords extern and static declare identifiers for variables of the static storage class
and for functions. ____________ variables exist from the point at which the program
begins execution and last for the duration of the program.
Question 5
counter-controlled repetition require , that tests for the final value, or by which the control value is modified.10 points
Question 6
Consider the execution of the following forloop
for (int x = 1; x < 5; increment )
cout << x + 1 << endl;
One way to replace increment is ______________________.
Question 7
Random numbers in a range can be generated with
number = + rand() % ;5 points
Question 8
In random number generations, shiftingValue is equal to the number in the desired range of consecutive integers and scalingFactor is equal to the of the desired range of consecutive integers.5 points
Question 9
Function can be used to round a number to a specific decimal
place. The statement
y = floor( x * 10 + .5 ) / 10;5 points
Question 10
When an argument is passed by , a of the argument
Explanation / Answer
Question 1
1) If a variable is declared in the initialization expression of a for statement, then:
b) The scope of the variable is restricted to that for loop.
Question 2
All of the following are reasons to use recursion except:
.
It maximizes execution performance.
Question 3
Using ___flaoting point__ _______ values for counters in counter-controlled repetition
Question 4
Keywords extern and static declare identifiers for variables of the static storage class
and for functions. ___global_________ variables exist from the point at which the program
begins execution and last for the duration of the program.
Question 5
counter-controlled repetition require , that tests for the final value, or by which the control value is modified.10 points
Question 6
Consider the execution of the following forloop
for (int x = 1; x < 5; increment )
cout << x + 1 << endl;
One way to replace increment is _____x++_________________.
Question 7
Random numbers in a range can be generated with
number = + rand() % 5 ;5 points