subject

You MUST use switch statement to complete the following. Write a program to achieve a four-function calculator. The program will first take two real (non-zero) numbers as input from the user. You can safely assume the user will always input two numbers. The program then outputs the following message to prompt another user input:

Please select:
: add two numbers.
-: subtract two numbers.
*: multiple two numbers.
/: divide two numbers.

The user then enters one of the above characters for the program to perform the corresponding calculation on the previously two numbers. If the user enters other character than the above, the program will print out Unknown calculation and exits.

Ex: if the user enters: 2.5 4 *
the program will output: 2.5 * 4

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 16:40, kaileyy06
Match each feature of e-publishing as an advantage, a disadvantage, a threat, or an opportunity. (choices) increased collaboration digitalized out-of-print versions monopoly over digital formats requirement for a specialized digital device pairs advantage of e-publishing disadvantage of e- opportunity for e- threat to e-
Answers: 1
image
Computers and Technology, 23.06.2019 04:40, Koriunaa
The narrative structure of the popular movies can be broken down into
Answers: 3
image
Computers and Technology, 23.06.2019 12:40, Emilyvite6251
According to the video what are some tasks petroleum engineers perform check all that apply
Answers: 2
image
Computers and Technology, 24.06.2019 10:50, latresyn
In 2009 to 2010, how many social network users were reported as being victims of online abuse? a. 1 in 10 b. 100% c.1 in 100 d. 50%
Answers: 2
You know the right answer?
You MUST use switch statement to complete the following. Write a program to achieve a four-functio...

Questions in other subjects:

Konu
Biology, 28.08.2020 19:01