Suppose the function from Display 3.7 has the return statement removed. Which of the statements below regarding this change are correct? Why?
```
void iceCream(int number, double totalWeight)
{
if(number == 0)
{
cout << “cannot divide among zero customers.\n”;
return;
}
portion = totalWeight/number;
cout << “Each one receives “
<< portion << “ ounces of ice cream.” <
a) The code will not compile.
b) The code will compile and run. The output will be unchanged.
c) The code will compile. For a zero number of customers the code would produce a
divide by zero run-time error.
d) The program will compile and run correctly for 1 or more customers. The error
for zero number of customers could be repaired by placing an else after the
block belonging to the if.
c) The code will compile. For a zero number of customers the code would produce a
divide by zero run-time error.
d) The program will compile and run correctly for 1 or more customers. The error
for zero number of customers could be repaired by placing an else after the
block belonging to the if.
You might also like to view...
What is wrong with the java.util.Stack implementation of a stack?
What will be an ideal response?
What is a buffer overflow?
What will be an ideal response?
What is a benefit of using more than one camera in a Scene at one time?
What will be an ideal response?
____ is the process of tracking the assets.
A. Asset management B. Risk identification C. Threat management D. Vulnerability identification