Problem 530. convert?
- Given a string containing a number followed by pounds or kgs, for example:
- 'Billy lost 22 pounds in four weeks.'
- 'Maria gained 10 kgs in 18 months.'
- If the unit was pounds, that amount should be converted to nearest rounded kgs:
- 'Billy lost 10 kgs in four weeks.'
- If the unit was kgs, that amount should be converted to nearest rounded pounds:
- 'Maria gained 22 pounds in 18 months.'
Solution Stats
Problem Comments
-
1 Comment
Jihye Sofia Seo
on 9 Feb 2017
Nice challenge!
Solution Comments
Show commentsProblem Recent Solvers41
Suggested Problems
-
Which values occur exactly three times?
5060 Solvers
-
Maximum running product for a string of numbers
2142 Solvers
-
Replace all zeros and NaNs in a matrix with the string 'error'
99 Solvers
-
8201 Solvers
-
Who is the smartest MATLAB programmer?
744 Solvers
More from this Author100
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!