Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 1. 1. (TCO 7) A function is _____ and a variable is _____. (Points : 4)

ID: 3822810 • Letter: Q

Question

Question 1.1. (TCO 7) A function is _____ and a variable is _____. (Points : 4)        declared, defined
       declared, declared
       defined, defined
       defined, declared Question 2.2. (TCO 7) What is a logical use for global variables? (Points : 4)        You don't have to keep passing variables between functions.
       They make programs easier to write.
       When working in a large group, there are no hassles with naming variables.
       Mathematical constants Question 3.3. (TCO 6) Which two key sequences are used to start debugging and stop debugging? (Points : 4)        F11 for start debugging and F10 for stop debugging
       F10 for start debugging and F11 for stop debugging
       F5 for start debugging and Shift-F5 for stop debugging
       Shift-F5 for start debugging and F5 for stop debugging Question 4.4. (TCO 5) Which of the following does counter-controlled repetition require? (Points : 4)        An initial value
       A condition that tests for the final value
       An increment or decrement by which the control variable is modified each time through the loop
       All of the above Question 5.5. (TCO 5) A loop that falls entirely within the body of another is a(n) _____ loop. (Points : 4)        outer
       nested
       parent
       restricted Question 6.6. (TCO 5) How many times will this for loop execute?

for (int i = 10; i > 0; --i) (Points : 4)        Seven
       Nine
       10
       Eight Question 7.7. (TCO 4) When you want an input value to be displaced as a two-place decimal, you should use _____. (Points : 4)        find(2)
       amount(2)
       setprecision(2)
       setfind(2) Question 8.8. (TCO 4) Consider the following segment of code.

if(apple == 5)
     cout<<"You got five apples!"<<endl;
else
     cout<<"You do not have five apples! ";
cout<<"The end of the program is reached.";

What will be the output on screen if apple is 5? (Points : 4)        You do not have five apples!
The end of the program is reached.
       You got “five” apples!
       You do not have five apples!
       You got five apples!
The end of the program is reached. Question 9.9. (TCO 4) Case statements are checked _____, but the order of the cases does not matter. (Points : 4)        according to their data value
       in sequential order
       in random order
       in break order and then default order according to the parent conditional expression Question 10.10. (TCO 3) What is the value of x after the following statement?
float x;
x = 3.0 / 4.0 + 3 + 2 / 5 (Points : 4)        1.75
       5.75
       3.75
       4.15 Question 11.11. (TCO 2) The endl can be found in which of the following namespaces? (Points : 4)        std
       string
       math
       comment Question 12.12. (TCO 2) The body of the main function starts with which of the following? (Points : 4)        .[
       .{
       }
       ] Question 13.13. (TCO 2) C++ comments are represented by which characters? (Points : 4)        // and /* */
       :: and //
       // and >>
       > Question 14.14. (TCO 1) What does IDE stand for? (Points : 4)        Integrated Development Environment
       Interpretive Development Engine
       Integrated Developer Engine
       None of these are correct. Question 15.15. (TCO 2) The following program displays: _____.
#include
using namespace std;

int main()
{
cout << "C++ is FUN"<<endl;
return 0;
} (Points : 4)        C++ is NOT FUN
       C++ is FUN
       C++ is Fun
       C++ is fun Question 1.1. (TCO 7) A function is _____ and a variable is _____. (Points : 4)        declared, defined
       declared, declared
       defined, defined
       defined, declared

Explanation / Answer

1. A function is a defined and a variable is a declared

2. You don't have to keep passing variables between functions.
   - A globally declared variable is available to all the functions for use.

3. F5 for start debugging and Shift-F5 for stop debugging  
   refer https://msdn.microsoft.com/en-in/library/8b59xk0f%28v=vs.90%29.aspx

4. All the above

5. A loop that falls within the body of another is a nested loop.

6. it executes 10 times

7. setprecision(2)

8. The output will be :
"You got five apples!"
The end of the program is reached.

9. case statements are checked sequentially, but the order of cases doesn't matter.


10. The answer is 3.75.
   It can be re-written as (3.0/4.0) + 3 + (2/5) = (0.75) + 3 + (0)
   notice that (3.0/4.0) are both represented as floating, so the result will also be floatin value. But in case of (2/5), both are integers, so the fractional part will be truncated and the result will be zero (an int).


11. endl is found in std namespace


12. It starts with an open curly bracket, {

   int main()
   {
       // code
   }

13. Comments are represented by // and /* */

14. IDE stands for Integrated Development Environment

15. C++ is FUN

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote