Exam 5: Functions for All Sub Tasks

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

A ________ is a simplified version of a function used to test the main program.

Free
(Short Answer)
4.8/5
(38)
Correct Answer:
Verified

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:
Verified

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:
Verified

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)

Call-by-reference parameters are passed

(Multiple Choice)
4.8/5
(34)

A stub is a function that is completely defined and well tested

(True/False)
4.8/5
(46)

A ___________ is a main program that only checks that functions execute correctly.

(Short Answer)
4.8/5
(49)

Which of the following is true for a void function?

(Multiple Choice)
4.9/5
(45)

The postcondition of a function

(Multiple Choice)
4.7/5
(46)

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)

Which of the following are true?

(Multiple Choice)
4.8/5
(42)

Using functions in a program is called _____________.

(Short Answer)
4.8/5
(35)

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)

The preconditions)for a function describe:

(Multiple Choice)
4.9/5
(35)

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
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)