Skip to content

Instantly share code, notes, and snippets.

@epoch
Last active February 23, 2016 22:19
Show Gist options
  • Select an option

  • Save epoch/65c83afc196cace85c8e to your computer and use it in GitHub Desktop.

Select an option

Save epoch/65c83afc196cace85c8e to your computer and use it in GitHub Desktop.
calc2

Wordy Arithmetic

Write a program that takes a word problem in the format:

What is 5 plus 13?

What is 7 minus 5?

What is 6 multiplied by 4?

What is 25 divided by 5?

and returns the answer as an integer.

The program should handle large numbers and negative numbers.

Extensions

  1. Modify your program to also handle problems of the type:

What is 7 plus 9 plus 3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment