The objective of this assignment is to practice working with characters and strings.

Your assignment is to write a program that answers a user's question about fractions. The user's input is formatted in English. For example, if the user enters:

1/2 plus 3 / 4 minus7/ 3 times 3 / 8 isYour program should respond with:

The answer is -13/32Note that the spacing around the "/" and around the operators "plus," "minus" and "times" is optional. That is, your program should handle the input properly when the user puts in the spaces, puts in extra spaces or leaves out the spaces. Division is specified using the words "divided by." For example, the user might enter:

17/3 divided by 9/5 isYour program should handle an arbitrary number of operations in the user's input line. However, you do not have to worry about operator precedence. Your program should provide some form of error checking and report syntax errors when they are detected. The sample runs at the end of this handout provide some examples of error checking.

- Allow the user to enter the input over several lines. The end of the question is specified by the word "is." Make sure that the program reports the syntax errors as soon as they are found.
- Print out the answer for mixed fractions as a whole number followed by a proper fraction. For example, if the answer is 9/5, the program should print out -1 4/5.
- Allow the user to enter whole numbers without a denominator. For example, the user might enter "1/2 plus 3 is".
- Allow the user to enter the input with mixed fractions. For example, the user might enter the line "1 and 2/3 plus 2 and 1/3 is". This feature is very difficult to implement correctly. You should try this only if you finish the project early. Essentially, you have to implement "and" as an operator with higher precedence than the other operators.

retriever% a.out Enter a question about fractions 1/2 plus 3 / 4 minus7/ 3 times 3 / 8 is The answer is -13/32 retriever% a.out Enter a question about fractions 1/2 plus 24/5 times 1/4 is The answer is 53/40 retriever% a.out Enter a question about fractions 1/2 plus 1/4 plus 1/8 plus 7/9 plus 3/16 minus 5/9 times 4/3 is The answer is 185/108 retriever% a.out Enter a question about fractions 17/3 divided by 9/5 is The answer is 85/27 retriever% retriever% a.out Enter a question about fractions 17\4 times 5 is Error: Illegal operator: \ retriever% a.out Enter a question about fractions 1/2 divide 4/3 is Error: Illegal operator: divide retriever% a.out Enter a question about fractions 1/2 divided 4/3 is Error: Syntax Error: "divided" not followed by "by".