Java Reference
In-Depth Information
The input format is shown in the following sample dialogue. If the user enters
any operator symbol other than + , , * , or / , then an UnknownOperatorException
is thrown and the user is asked to reenter that line of input. Defining the class
UnknownOperatorException is part of this project.
Calculator is on.
result = 0.0
+5
result + 5.0 = 5.0
new result = 5.0
*2.2
result * 2.2 = 11.0
updated result = 11.0
% 10
% is an unknown operation.
Reenter, your last line:
* 0.1
result * 0.1 = 1.1
updated result = 1.1
r
Final result = 1.1
Again? (y/n)
yes
result = 0.0
+10
result + 10.0 = 10.0
new result = 10.0
/2
result / 2.0 = 5.0
updated result = 5.0
r
Final result = 5.0
Again? (y/n)
N
End of Program
Search WWH ::




Custom Search