Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions

Question

If you were Akio, what would you do now?

Answered: 1 week ago