Question: 1. Define stubs for the functions called by the below main(). Each stub should print FIXME: Finish FunctionName() followed by a newline, and should return
1. Define stubs for the functions called by the below main(). Each stub should print "FIXME: Finish FunctionName()" followed by a newline, and should return -1.
Example output:
FIXME: Finish GetUserNum()
FIXME: Finish GetUserNum()
FIXME: Finish ComputeAvg() Avg: -1
#include
/* Your solution goes here */
int main() { int userNum1; int userNum2; int avgResult;
userNum1 = GetUserNum(); userNum2 = GetUserNum();
avgResult = ComputeAvg(userNum1, userNum2);
cout << "Avg: " << avgResult << endl;
return 0; }
2. Complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 3, print "Too small". If greater than 10, print "Too large". Otherwise, compute and print 6 * bagOunces followed by "seconds". End with a newline. Example output for ounces = 7:
42 seconds
#include
void PrintPopcornTime(int bagOunces) {
/* Your solution goes here */
}
int main() { PrintPopcornTime(7);
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
