Answer to Question #24677 in C++ for red rose

Question #24677
A balance has the following size weights: 100 lb, 50 lb, 10 lb, 5 lb, and 1 lb. The number of 100 lb and 50 lb weights required to weigh an object weighing weight pounds can be calculated by using the following C++ statements:

// Determine the number of 100 lb weights

w100 = int(weight/100)

// Determine the number of 50 lb weights

w50 = int((weight – w100 * 100)/50)
Using these statements as a starting point, write a C++ program that accepts a weight input from the user and then calculates the number of each type of weight needed to weigh that object.
0
Expert's answer

Answer in progress...

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS