write a function that converts an input of some integer number of ounces into ou
ID: 3639401 • Letter: W
Question
write a function that converts an input of some integer number of ounces into outputs of integer numbers of quarts, pints, and ounces. do not write a main function. your function does not do cin or cout. your function will have four parameters. make sure you use appropriate parameter passing techniques! your function will be a void function. there are 16 ounces in a pint, and 32 ounces in a quart. for example, if the total number of ounces input is 50, the result are 1 quart, 1 pint, and 2 ounces.Explanation / Answer
void function(int q,int p,int o,int total_ounces) { q=(total_ounces/32); o=total_ounces-(32*q); total_ounces=o; p=(total_ounces/16); o=total_ounces-(16*p); total_ounces=o; }
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.