I rang the bell and Mary answered the door, "Hello" she said, "come in, Oh! I have 1001 things to do and only the morning to do them in". "Ah!", I said, "that means you will have to do n per minute."
Your challenge is to create a programme that will accept text input so that you may type in Mary's statement starting with "come in..." and ending at "them in". Parse this statement extracting the numerical values from the statement. Write a programme to calculate how many things she has to do a minute and then output the answer as a text statement using the text starting "that means" and ending "per minute". The answer to n may be given in figures.
Assume a morning is 4 hours. Rounding allowed in the answer.
The basic problem is fairly simple but requires parsing a sentence for the relevant information. The first extension below is more difficult because now you must write a parser that recognizes numbers in word form.
How would your code differ if the input phrase contained " a thousand and one" instead of 1001?
How would your code differ if the output phrase had to use words instead of figures for the answer?
Write the programme to output the answer for a variable morning of 3, 4 and 5 hours.