Question: Q 1 . [ 2 0 ] For Q 1 , write a small program to solve the problem. Your programs must include the function
Q For Q write a small program to solve the problem. Your programs must include the function prototype,
function call, and function definition. Submit a screenshot of the code and screenshots of the output using
several cases. You do not need the analysis and algorithm for this part. You must also upload your c files.
a Define a function PrintFeetInchShort with int parameters numFeet and numInches, that prints the
dimensions using the and "shorthand. The user will enter the values for feet and inches in main and the
PrintFeetInchShort will be called. For example, if numFeet is and numInches is the function prints
Hint: Use in the printf to print a double quote.
b Write a function PrintPopcornTime which prints the time in seconds needed to pop a bad of popcorn.
The user enters the size of the bag in ounces int bagounces in main and calls the function. In the
function, if bagounces is less than print "Too small". If greater than print "Too large". Otherwise,
compute and print the seconds needed to pop the bag where seconds bagounces.
c Define a function PyramidVolume with float data type parameters baseLength, baseWidth, and
pyramidHeight, that returns as a float the volume of a pyramid with a rectangular base. The user enters
the values for length, width, and height in main using scanf; the volume is calculated in the function
but printed in main Relevant geometry equations:
Volume base area height
Base area base length base width.
Watch out for integer division
Q For Q write a small program to solve the problem. Your program must include the function prototype,
function call, and function definition. Submit a screenshot of the code and screenshots of the output using
several cases. You also need the analysis and algorithm for this part. In this case there will be an algorithm for the
main program and a separate algorithm for the function.
Write a program to calculate the temperature inside the earth at a certain depth. In main the user is asked
for depth within the earth. The user will call a function tempdepth which would calculate the
temperature at the depth in Celsius and Fahrenheit using the formulas below. Both temperatures will be
calculated in the function but will be printed in main
The temperature in Celsius at a given depth is calculated as:
Celsius depth
Convert to Fahrenheit using the following:
Fahrenheit Celsius
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
