Question: (In C++) You may be asked to create a function to solve each of the tasks given below. For each task state the purpose of

(In C++) You may be asked to create a function to solve each of the tasks given below. For each task state the purpose of the function, what the function needs complete the task (input), what the function will send back to the function call (output), and the process (algorithm) needed to complete the task. Do not write any C++ code, but clearly specify input needed, output expected, and algorithm. Also state which parameters should be passed by value and which should be passed by reference (review sections 6.5 and 6.13 of your textbook). Problem 1: Design a function that will calculate both the volume and surface area of a cone given a radius and height (validated elsewhere in the program). Your function should not contain any input statements or any output statements. Both the volume and surface area should be sent back to the function call. Problem 2: Describe a function (mini-progam) that would accept 7 values from the function call and determine the minimum of those 7 values. Design this function without using the idea of arrays. Send back to the function call the minimum value. Hint, you should use no more than 7 comparisons (relational operators) to find the minimum. Problem 3: Design a function for the scenario given below. The XYZ company produces widgets which need to be packaged into bags, boxes, and cases. A bag contains six (6) widgets. A box contains 12 bags (72 widgets). A case contains 10 boxes (720 widgets). Determine the number of bags, boxes, cases and leftover widgets from the number of widgets produced during a shift. For example if the user entered 3951 widgets that would correspond to 5 cases, 4 boxes, 10 bags and 3 leftover widgets. Your function should be designed to use less than 7 arithmetic operations. Your function should not contain any input statements or any output statements.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!