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
A ________ is a simplified version of a function used to test the main program.
Free
(Short Answer)
4.8/5
(38)
Correct Answer:
stub
What is the correct way to call the following function? Assume that you have two variables named intArgument int)and floatArgumentfloat).
void doThingsfloat x,int y);
Free
(Short Answer)
4.8/5
(35)
Correct Answer:
doThingsfloatArgument,intArgument);
Given the following function declaration and local variable declarations,which of the following is not a correct function call?
Int myInt;
Float myFloat;
Char ch;
Void someFunctionint& first,float second,char third);
Free
(Multiple Choice)
4.9/5
(37)
Correct Answer:
A
If you were to write a function for displaying the cost of an item to the screen,which function prototype would be most appropriate?
(Multiple Choice)
4.8/5
(34)
pre and post conditions for a function should be written before/after)the function definition is written.
(Short Answer)
4.7/5
(39)
A ___________ is a main program that only checks that functions execute correctly.
(Short Answer)
4.8/5
(49)
It is acceptable to have both call-by-value and call-by-reference parameters in the same function declaration.
(True/False)
4.8/5
(33)
What is wrong with the following function body?
Void calculateint count,float price,float& cost)
{
If count < 0)
Cost=0.0;
Else
Cost=count*price;
Return;
}
(Multiple Choice)
4.9/5
(36)
It is illegal to call other functions from inside a function definition.
(True/False)
4.9/5
(36)
In the following function,what is passed to the first parameter?
Void f1 int& value1,int value2);
Int x,y;
F1x,y);
(Multiple Choice)
4.8/5
(28)
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
(35)
Which of the following is a legal call to the displayOutput function?
Void displayOutputint total);
(Multiple Choice)
4.9/5
(34)
Testing a program with values that are close to values that will change the execution of a program is called _________________.
(Short Answer)
4.7/5
(41)
Showing 1 - 20 of 53
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)