This lab will serve as a review for the midterm. It will involve a collection of short answer, code error correction, and small functions. 1. If a programming language does not use short-circuit evaluation, what is the output of the following code fragment if the value of myInt is 0? int other=3, myInt; if(myInt !=0 && other % myInt !=0) cout << "other is odd\n"; else cout << "other is even\n"; 2. if x is 0, what is the value of (!x ==0)? 3. Which of the following are equivalent to (!(x<15 && y>=3))? a. (x>15 && y<=3) b. (x>=15 && y < 3) c. (x>=15 || y < 3) d. (x>15 || y < 3) e. C and D 4. What is wrong with the following switch statement? int ans; cout <<"Type y for yes on n for no\n"; cin >> ans; switch (ans){ case 'y': case 'Y': cout << "You said yes" << endl; break; case 'n': case 'N': cout << "You said no" << endl; break; default: cout << "invalid answer" << endl; } 5. A ___________ is a main program that only checks that functions execute correctly 6. When the address of the actual argument is passed to the formal parameter, this is called __________________________ 7. What symbol is used to signify that a parameter is a reference parameter? ______ 8. What is the output of the following function and function call? void calculateCost(int count, float& subTotal, float& taxCost); //begin fragment float tax = 0.0, subTotal = 0.0; calculateCost(15, subTotal,tax); cout << "The cost for 15 items is " << subtotal << ", and the tax for " << subTotal << " is " << tax << endl; //end of fragment void calculateCost(int count, float& subTotal, float& taxCost){ if ( count < 10){ subTotal = count * 0.50; } else { subTotal = count * 0.20; } taxCost = 0.1 * subTotal; } 9. What is wrong with the following function body? void calculate(int count, float price, float& cost) { if (count < 0) cost=0.0; else cost=count*price; return; } 10. "#include " is known as an ___________________. 11. When overloading a function, what must be true? a. The names should be different with the same number and/or types of parameters. b. The names should be the same with different number and/or types of parameters. c. The names should be different with different number and/or types of parameters. d. The names should be the same with the same number and/or types of parameters. 12. What is the opposite of ( x < 20 && x > 12)? _______________________ 13. In a compound logical and (&&) expression, the evaluation of the expression stops once one of the terms of the expression is false. This is known as ___________________. 14. Write a function which returns the max of a vector of integers. 15. Write a function which returns the min of a vector of integers. 16. Write a function which returns the min, max, and standard deviation of a vector of values. Assume you have functions min, max, and stdev already defined for vectors. 17. A digit that can hold a zero or a one is known as a ___________. 18. If your program compiles and runs, but gives an incorrect output, this is known as a _________ error. 19. Who developed C++? a. Bjarne Stroustrup b. Ken Thompson c. Charles Babbage d. Ada Lovelace 20. What does the following print to the screen? cout << "Hello Students/n"