Question: C++ QUESTION. INTRO TO C++ COURSE Write two functions as follows: One function is named all_inches and takes two int parameters, f and i that
C++ QUESTION. INTRO TO C++ COURSE
Write two functions as follows: One function is named all_inches and takes two int parameters, f and i that represent a length in feet and inches. The function returns an int that is the length in all inches, so all_inches(2, 6) returns 30 (2 feet 6 inches = 30 inches). The other function is named feet_inches and takes three parameters, n, f, i. The first parameter is an int that represents a length in all inches, and the other two are output reference parameters that will receive the feet and inches values, so feet_inches(30, ft, in) will set ft to 2 and in to 6.
Write a main program that reads in two lengths from the user as feet and inches and uses the functions to compute the sum of the lengths. Also, use the functions to compute a length that is double the first length entered and another that is triple the second length entered. Print out the sum, double and triple lengths as feet and inches.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
