Question

Select the correct definition at right for each of the terms at left (matching):                             &nbsp

Select the correct definition at right for each of the terms at left (matching):

                                                            A.   Changes to these parameters inside a function will not cause

1.   Local Variables ________                      the corresponding argument values to change.

                                                            B.   Their values are not allowed to be changed.

                                                            C.   Declared in the body of a function. They are accessible

2.   Array ______                                         only within a limited scope.

                                                            D.   Denoted with an ampersand (&). Indicates that arguments

                                                                  passed into a function will be modified if the formal

3.   Call-by-Value ________                         parameter’s value is changed in the function body.
(Pass-by-Value)                               E.   A group of variables that are of the same data type, and are

                                                                  stored sequentially in adjacent memory locations.

4. Which of the following pieces of code will output “true” if and only if x is between 5 and 10 (including)?__________

A.         if(5 <= x <= 10) cout << "true";

B.   if(x >= 5 || x <= 10) cout << "true";

C. if(x >= 5 && x <= 10) cout << "true";

bool inRange = (x >= 5 && x <= 10);
if(inRange) cout << "true";

Both B and D are right.

5.         What will be output by the following code? _____________

int z = 15;

if (z < 10) cout << " under 10";

else if (z < 20) cout << " under 20";

else if (z < 30) cout << " under 30";

else cout << " over 30";

            A.         under 10 under 20 under 30 over 30        B.    under 20 under 30 over 30

            C.         under 20 under 30       D.    under 20                E.    under 30

0 0
Add a comment Improve this question Transcribed image text
Answer #1

here are the answers..

===============================================================

Ans:1

1         C

2         E

3         A

==============================================================

Ans:4

C. if(x >= 5 && x <= 10) cout << "true";

==============================================================

Ans:5

D.    under 20  

===============================================================

Kindly Check and Verify Thanks..!!!

Add a comment
Know the answer?
Add Answer to:
Select the correct definition at right for each of the terms at left (matching):                             &nbsp
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • QUESTION 1 What is the output of the following code snippet? int main() { bool attendance...

    QUESTION 1 What is the output of the following code snippet? int main() { bool attendance = false; string str = "Unknown"; attendance = !(attendance); if (!attendance) { str = "False"; } if (attendance) { attendance = false; } if (attendance) { str = "True"; } else { str = "Maybe"; } cout << str << endl; return 0; } False True Unknown Maybe QUESTION 2 What is the output of the following code snippet? #include <iostream> #include <string> using...

  • Here is a function that takes, and returns pointers: 2 int* select(bool which, int* a, int*...

    Here is a function that takes, and returns pointers: 2 int* select(bool which, int* a, int* b) { if(which == true) return a; else return b; } Using this function, suppose we have variables x, y: int x = ..., y = ...; int* p = select(x < y, &x, &y); if(p == &x) cout << "Yes"; else cout << "No"; What will this print if x = 5, y = 7? What will this print if x = 23, ...

  • Question 1 (8 points): Choose the Correct Answer (2 points for each question) 1. What are...

    Question 1 (8 points): Choose the Correct Answer (2 points for each question) 1. What are the values of the variables x and y after executing the following code? intx=0,y-2; if (x0) y-13 else y-2;) c, x = 1,y=1 d.x-1,y 2 of the following will output Yes only if the integer variable numis either 2.3, 4, or 5? a. if ((2--num) II (nurn<-5)) {cout << "Yes" << endl; } miT b. İfQ2(num) & (num >-5)) {cout << "Yes"くくendl; } c....

  • QUESTION 1 Which statement results in the value false? The value of count is 0; limit...

    QUESTION 1 Which statement results in the value false? The value of count is 0; limit is 10. (count != 0)&&(limit < 20) (count == 0)&&(limit < 20) (count != 0)||(limit < 20) (count == 0)&&(limit < 20) 10 points    QUESTION 2 If this code fragment were executed in an otherwise correct and complete program, what would the output be? int a = 3, b = 2, c = 5 if (a > b) a = 4; if (...

  • A_____error causes the program to prematurely terminate during execution. ==.!=.>.<= are examples of____operators. A_____loop always executes...

    A_____error causes the program to prematurely terminate during execution. ==.!=.>.<= are examples of____operators. A_____loop always executes its body at least once. The function_______lets the compiler know that the function will be defined later. The_____statement skips to the end of the body of a loop. The_____loop has a header which consists of three sections separated by semicolons. The____of an infinite loop is always true. A(n)____statement cannot exist without an if statement. The_____of a variable tells the compiler which values it can...

  • program. 13. What's the output of the following program? #include< iostream> #include&math> using namespace std; int...

    program. 13. What's the output of the following program? #include< iostream> #include&math> using namespace std; int p 7; void main) extern double var int p abs(-90); system( "pause"); double var = 55; 14. How many times does "#" print? forlint i 0;j< 10; +ti) if(i-2141 6) continue; cout<< "#"; 15. Write the function declaration/prototype for a, pow function b floor function 16. State True or False a. b. c. d. e. isupper function returns a double value for loop is...

  • Add a recursive Boolean function called checkRecurse to class IntegerLinkedList to check if any two consecutive...

    Add a recursive Boolean function called checkRecurse to class IntegerLinkedList to check if any two consecutive integers in the linked list are equal (return true in this case, false otherwise). You may assume that the list is not empty. A recursion “helper” function is already included in class IntegerLinkedList. You only need to write the recursive function. For example, checkRecurseHelper() should return true for the linked list shown below. A main function (prob3.cpp) is given to you to add data...

  • So far your TestEqual functions have tested values but haven't made any changes... Q: If you...

    So far your TestEqual functions have tested values but haven't made any changes... Q: If you changed one of the variable values in your function, would it change the value of the variable in main? Why? Q: What are the two options for passing parameters into a function? (by _________ and by __________) What's the difference? Write a new function, MakeEqual, that takes two integers and if they are not equal (tested using your TestEqual function), displays a message and...

  • Write a function, swapSubtrees, that swaps all of the left and right subtrees of a binary...

    Write a function, swapSubtrees, that swaps all of the left and right subtrees of a binary tree. Add this function to the class binaryTreeType and create a program to test this function. #include <iostream> using namespace std; //Definition of the Node template <class elemType> struct nodeType { elemType info; nodeType<elemType> *lLink; nodeType<elemType> *rLink; }; //Definition of the class template <class elemType> class binaryTreeType { public: //Overload the assignment operator. const binaryTreeType<elemType>& operator=(const binaryTreeType<elemType>&) { if (this != &otherTree) //avoid self-copy...

  • This a lab for C++ using visual studio 2017 Lab 10 Total 50 points Stacks and...

    This a lab for C++ using visual studio 2017 Lab 10 Total 50 points Stacks and Queues - Part A (40 points) Finish the code for Lab10aStacksAndQueues.cpp . You will write code for the same function which will return true if the values of the elements of the vector that is passed to it are the same read both forwards and backwards. If they are not the same in both directions, it will return false. Don’t change anything in the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT