Exam 5: Functions for All Sub Tasks
Exam 1: Introduction to Computer and C Programming55 Questions
Exam 2: C++ Basics54 Questions
Exam 3: More Flow of Control44 Questions
Exam 4: Procedural Abstraction and Functions That Return a Value51 Questions
Exam 5: Functions for All Sub Tasks53 Questions
Exam 6: Io Streams As an Introduction to Objects and Classes51 Questions
Exam 7: Arrays34 Questions
Exam 8: Strings and Vectors63 Questions
Exam 9: Pointers and Dynamic Arrays40 Questions
Exam 10: Defining Classes50 Questions
Exam 11: Friends, overloaded Operators, and Arrays in Classes49 Questions
Exam 12: Separate Compilation and Namespaces38 Questions
Exam 13: Pointers and Linked Lists51 Questions
Exam 14: Recursion43 Questions
Exam 15: Inheritance53 Questions
Exam 16: Exception Handling47 Questions
Exam 17: Templates33 Questions
Exam 18: Standard Template Library57 Questions
Select questions type
What is the output of the following code fragments?
Int trial int& a,int b)
{
Ifb > a)
{
A=b;
Return -a;
}
Else
{
Return 0;
}
}
Float x=0,y=10,z;
Z=trialy,x);
Cout << z << " " << x <<" " << y << endl;
(Multiple Choice)
4.9/5
(44)
In a function with call-by-reference parameters,the values of the actual arguments are passed to the function.
(True/False)
4.8/5
(35)
Given the function definition
Void something int a,int& b )
{
Int c;
C = a + 2;
A = a * 3;
B = c + a;
}
What is the output of the following code fragment that invokes something?
All variables are of type int.)
R = 1;
S = 2;
T = 3;
Somethingt,s);
Cout << r << ' ' << s << ' ' << t << endl;
(Multiple Choice)
4.8/5
(33)
Testing a function or program using test values that are at or near the values that change the outcome of the program is known as using
(Multiple Choice)
4.8/5
(38)
A simplified version of a function which is used to test the main program is called
(Multiple Choice)
4.8/5
(41)
If a function needs to modify more than one variable,it must
(Multiple Choice)
4.8/5
(26)
The values or variables listed in the function declaration are called _________ to the function.
(Short Answer)
4.8/5
(36)
If we want to test if a given function works correctly,we would write a _________ to test it.
(Short Answer)
5.0/5
(35)
A function that does not return a value is known as a ________ function.
(Short Answer)
4.8/5
(38)
What is the output of the following function and function call?
Void calculateCostint count,float& subTotal,float& taxCost);
Float tax = 0.0,
SubTotal = 0.0;
CalculateCost15,subTotal,tax);
Cout << "The cost for 15 items is " << subtotal
<< ",and the tax for " << subTotal << " is " << tax << endl;
//end of fragment
Void calculateCostint count,float& subTotal,float& taxCost)
{
If count < 10)
{
SubTotal = count * 0.50;
}
Else
{
SubTotal = count * 0.20;
}
TaxCost = 0.1 * subTotal;
}
(Multiple Choice)
4.9/5
(37)
In a function with call-by-reference parameters,any changes to the formal parameters will change the actual arguments passed to the function.
(True/False)
4.7/5
(35)
If you write a function that should use call-by-reference,but forget to include the ampersand,
(Multiple Choice)
4.9/5
(47)
What is the correct way to call the following function? _________________________
void setDisplay);
(Short Answer)
4.9/5
(37)
Showing 21 - 40 of 53
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)