Develop with Java programming language a calculator (console application) that takes a number, a basic math operator ( + , - , * , / , % ), and a second number all from user input, and have it print the result of the mathematical operation. The mathematical operations should be wrapped inside of functions. Note: Do please use the provided source code template to implement your solution. The purpose of this problem is not only to assess the students' ability to build
Develop with Java programming language a calculator (console application) that takes a number, a basic math operator ( + , - , * , / , % ), and a second number all from user input, and have it print the result of the mathematical operation. The mathematical operations should be wrapped inside of functions.
Note: Do please use the provided source code template to implement your solution. The purpose of this problem is not only to assess the students' ability to build a valid implementation but also to assess the ability to read the Java code.
Input:
On single line a number, a basic math operator ( + , - , * , / , % ), and a second number all from user input.
Output:
On new line result of the mathematical operation. In the case of "Division by zero" you must printout the text message "Error".
The code must have the structure as shown in the picture and should work for negative numbers as well
Step by step
Solved in 2 steps with 1 images