Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This is implemented in C.run--I named it as python because the syntax highlighting is close.
- real pounds_per_kilo = 2.2
- int ounces_per_pound = 16
- # Get the number of kilos from the user:
- real kilos = prompt "How many kilos?"
- # Convert that number into ounces:
- real total_ounces = kilos * pounds_per_kilo * ounces_per_pound
- # Find out how many complete pounds you can get from those ounces:
- int pounds = total_ounces / 16
- # Find out how many ounces are left over:
- real ounces = total_ounces % 16
- # Print the results:
- print pounds + " lbs, "+ ounces +" oz."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement