Write a program that reads an amount in dollars and two names
then formats and prints the following message:
<name1> owes $<amount> dollars to <name2>.
Input contains several lines each with a decimal number and two names separated by spaces. The decimal number is greater than 0.0 and smaller than 999.0 and has up to two decimal places. The two names have up to 30 characters.
For each line of input,
output should contain a corresponding line line with the following message:
<name1> owes $<amount> dollars to <name2>.
The amount should be rounded to two decimal places and have no leading zeroes.
Input is terminated by the end-of-file (EOF).
1.5 John Mary
199 Jane Mario
John owes $1.50 dollars to Mary.
Jane owes $199.00 dollars to Mario.
try first: age
Copyright © 2020-2022 Rudy Matela
This text is available under the CC BY-SA 4.0 license.
Originally available on cscx.org/owes