1)Complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 3,...
Question:
1)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(void) {
PrintPopcornTime(7);
return 0;
}
2)Write a function PrintShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, print "Too few.". If more than 4, print "Too many.". Else, print "N: Lather and rinse." numCycles times, where N is the cycle number, followed by "Done.". End with a newline. Example output for numCycles = 2:
1: Lather and rinse. 2: Lather and rinse. Done.
Hint: Define and use a loop variable.
#include
/* Your solution goes here */
int main(void) {
PrintShampooInstructions(2);
return 0;
}