Question: Problem Description Write a python program that will interpret pseudo - English statements describing an amount of money in coins and convert them into a

Problem Description
Write a python program that will interpret pseudo-English statements describing an amount of money in coins and convert them into a dollar amount.
Input
Each sentence will follow the standard rules of English grammar, the only exception being the omission of the ending punctuation. The format of a sentence will consist of a quantity and a denomination. The quantity will always be a numeral and the denomination will always be a word.
Output
Each output should be an amount listed in dollars
Test Cases
1 penny and 2 nickels ->0.11
4 dimes and 7 quarters ->2.15
1 quarter and 3 pennies ->0.28
21 pennies and 17 dimes and 52 quarters ->14.91
95 dimes and 73 quarters and 22 nickels and 36 pennies ->29.21
1 nickel and 17 quarters ->4.30
21 nickels and 15 pennies ->1.20
1 dime and 1 nickel and 1 penny and 1 quarter ->0.41
Feel free to include any other test cases you think would be appropriate.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!