Command Line Calculator The program will ask the user to select a function from 1-5 (1-Add, 2-Subtract, 3-Multiply, 4- Divide, 5-Exit the program). Afterwards, the program asks for two inputs from the user and prints out the result of the two numbers given which operation the user selected. After printing the result, loop back to asking the user to select a function again until he enters 5 to exit the program. Try to complete this task using methods for each function and using loops. Please use IF and ELSE COMMAND. Please use JAVA.

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter9: Formula Auditing, Data Validation, And Complex Problem Solving
Section: Chapter Questions
Problem 5EYK
icon
Related questions
Question
Command Line Calculator The program will ask the user to select a function from 1-5 (1-Add, 2-Subtract, 3-Multiply, 4- Divide, 5-Exit the program). Afterwards, the program asks for two inputs from the user and prints out the result of the two numbers given which operation the user selected. After printing the result, loop back to asking the user to select a function again until he enters 5 to exit the program. Try to complete this task using methods for each function and using loops. Please use IF and ELSE COMMAND. Please use JAVA.
Please select from below choices:
1 - Add
2
Subtract
3 - Multiply
4- Divide
5- Exit the program
Please enter your choice: 1
Enter first number: 44
Enter second number: 27
Result: 71
Please select from below choices:
1 - Add
2
Subtract
3 - Multiply
4 - Divide
5 Exit the program
Please enter your choice: |
Result: 8
Please select from below choices:
1 - Add
2- Subtract
3- Multiply
4 Divide
5 Exit the program
Please enter your choice: 5
Will now exit the program.
-
Transcribed Image Text:Please select from below choices: 1 - Add 2 Subtract 3 - Multiply 4- Divide 5- Exit the program Please enter your choice: 1 Enter first number: 44 Enter second number: 27 Result: 71 Please select from below choices: 1 - Add 2 Subtract 3 - Multiply 4 - Divide 5 Exit the program Please enter your choice: | Result: 8 Please select from below choices: 1 - Add 2- Subtract 3- Multiply 4 Divide 5 Exit the program Please enter your choice: 5 Will now exit the program. -
Expert Solution
steps

Step by step

Solved in 5 steps with 4 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Can you please use IF and ELSE command?

Solution
Bartleby Expert
SEE SOLUTION
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
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
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning