The finally Block
easyQuestion 735Read two integers and print Result: <a / b>. Catch a DivideByZeroException and print Error. In every case, print Done from a finally block (it runs whether or not an exception occurred). Use top-level statements.
Input 8 then 4 prints the output shown in Expected Output.
Input 8 then 0 prints:
Error
Done
Expected output
Result: 2 Done
= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
Exceptions
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cw, cr, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.