81.7k views
3 votes
Define a function ConvertWeight() that takes one integer parameter as totalOunces, and two integer parameters passed by reference as pounds and ounces. The function converts totalOunces to pounds and ounces. The function does not return any value.

1 Answer

2 votes

Final answer:

To convert totalOunces to pounds and ounces, divide the totalOunces by 16 to get the pounds, and the remainder will be the number of ounces.

Step-by-step explanation:

To convert totalOunces to pounds and ounces, we need to divide the totalOunces by 16 to convert it into pounds. The remainder after division will be the number of ounces. Let's say the totalOunces is 32. Dividing 32 by 16 gives us 2, so the pounds would be 2. The remainder is 0, which means there are no remaining ounces.

User Khaled Ahmed
by
7.9k points