
Can you help me a C++
Create a program that reads a simple arithmetic expression and
evaluates it. More precisely, the program reads from the user a line of
text that’s supposed to contain two numbers separated by an arithmetic
operator, as in
35.6 + 12
The program then prints back the expression and its value, as in
35.6 + 12 = 47.6
The program should verify that the input line contains two numbers, one
operator and nothing else. There can be whitespace before the first number, after the second number and between each number and the operator.
The operator can be either +, −, * or /. In case of an error, the program
should print Invalid expression and quit.
When the program prints the expression, there should be no whitespace
before the first number and there should be exactly one blank space before
and after the operator and the equal sign.
Use string streams.

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 3 images

- PYTHON PROGRAMMINGarrow_forwardC level program 1. Write a program that takes an integer n as input (from Keyboard) and compute and display (a) The sum of digits. (b) The integer with digits reversed, and multiplied by 3. For example, if the input is 4318, then in part (a), you'll display integer 4318, and sum of digits 4 + 3 + 1 + 8 = 16; and in part (b), you'll compute and display 8134 and also 24402, which is 4318 * 3. (c) Test your program with 3 integers: 4318, 401, and an integer of 5 digits of your choice. Show and explain source code and show outputarrow_forwardC++arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





