1 Attachment(s)

Help to do a calcutalor for arithmetic and relations !!!!Pls

=>Create a calculator for arithmetic and relations calculations

Prompt the user to enter an equation in the following format:

oprand1 op oprand2

oprand1 and oprand2 are both numbers and op should support common mathematical expressions. Your program should support the following arithmetic operators: +, -, *, /, % and the following relational operators: <, <=, >, >=, ==,!=. The program should keep prompting the user for new input until user provide exit signal.

Details / Assumption / Hints

1) Multiple Inputs

2) Note that % operator requires integers, so if user enters doubles for that operation, you cast it to int and include the “Loss of Precision” message

3) You need to handle the difference between arithmetic (a number) and relational (Boolean) results.

4) You can either have the user enter some values to exit the loop or use cin.fail() to exit the loop

5) Extra credit: Use string to read data from command line and then tokenized to extract the three values

6) ** Do not use character to read in the op, some operators have two characters. Use string and strcmp()

Sample Out :