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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:30
Imagine that you have a friend who is starting a small business and is interested in using social media to spread the word. he is not certain that it is a good move, and has come to you for . would you advise him to use social media to advertise his business? why or why not? support you answer with information from the text.
Answers: 1
question
Computers and Technology, 23.06.2019 01:30
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most? a)give the file a unique name b)name the file in yymmdd format c)use descriptive name while naming the files d)use capital letters while naming the file
Answers: 3
question
Computers and Technology, 23.06.2019 01:50
Create a class named majors that includes an enumeration for the six majors offered by a college as follows: acc, chem, cis, eng, his, phys. display the enumeration values for the user, then prompt the user to enter a major. display the college division in which the major falls. acc and cis are in the business division, chem and phys are in the science division, and eng and his are in the humanities division. save the file as majors.java.
Answers: 2
question
Computers and Technology, 23.06.2019 04:00
In a word processing program, such as microsoft word, which feature to you choose the desired picture enhancement?
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
question
Mathematics, 13.11.2019 08:31
Questions on the website: 13722363