This is a program that will evaluate simple expressions


This is a program that will evaluate simple expressions such as 17 + 3 and 3.14159 * 4.7. The expressions are to be typed in by the user. The input always consists of a number, followed by an operator, followed by another number. The operators that are allowed are +, -, *, and /. You can read the numbers with TextIO.getDouble() and the operator with TextIO.getChar(). The program should read an expression, print its value, read another expression, print its value, and so on. This program should end when the user enters 0 as the first number on the line.

Solution Preview :

Prepared by a verified Expert
Business Economics: This is a program that will evaluate simple expressions
Reference No:- TGS02892382

Now Priced at $10 (50% Discount)

Recommended (90%)

Rated (4.3/5)