Write a simple calculator program that use 2 numbers entered by the user to perform any of the following mathematical operations depending on the user’s choice: +,-,*, /, square root. When the program starts a list of mathematical expressions should be appears on top of the screen; the user should enter a number between 1 and 4 to select an operation. The user should then be prompted for the first and second numbers, and finally display the results as shown below

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter3: Assignment, Formatting, And Interactive Input
Section3.4: Program Input Using Cin
Problem 9E
icon
Related questions
Question

Write a simple calculator program that use 2 numbers entered by the user to perform any of the following mathematical operations depending on the user’s choice: +,-,*, /, square root. When the program starts a list of mathematical expressions should be appears on top of the screen; the user should enter a number between 1 and 4 to select an operation. The user should then be prompted for the first and second numbers, and finally display the results as shown below

Console X
**
<terminated> Mmm [Java Application] C:\Program Files\Java\jdk-16\bin\javaw.exe (20 May 2022, 09:30:46 – 09:30:56) [pid: 22236]
Please select option to use.... Only use number to make Selection
1. For Addition (+)
2. For Subtraction (-)
3. For Multiplication (*)
4. For Division (/)
5. For Square root (V)
4
Please enter 1st number: 36
Please enter 2nd number: 5
Division of two numbers is :7.2
Transcribed Image Text:Console X ** <terminated> Mmm [Java Application] C:\Program Files\Java\jdk-16\bin\javaw.exe (20 May 2022, 09:30:46 – 09:30:56) [pid: 22236] Please select option to use.... Only use number to make Selection 1. For Addition (+) 2. For Subtraction (-) 3. For Multiplication (*) 4. For Division (/) 5. For Square root (V) 4 Please enter 1st number: 36 Please enter 2nd number: 5 Division of two numbers is :7.2
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning