Question: Write a C + + program that does the following: * 1 - Declare two double variables num 1 and num 2 * 2 -

Write a C++ program that does the following:
*1- Declare two double variables num1 and num2
*2- declare a character variable op to contain the characters '+','-','/', or '*'/
Ask the user for an expression in the form 23.4*5.3(A number followed by
the operation/character followed by another number.
If the input was 23.4*5.3 then num1 will be 23.4, op ='*', num2=5.3
if the charater us +, then perform an addition and display the result
else if the charater us -, then perform a subtraction and display the result
ad so on.... for * and /
if the character is none of the above then display the message "Invalid operation".

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!