Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+10 votes

Should the MegaCalc class be catching errors when I am adding larget digit integer numbers?

asked in CSC212_Spring2019 by (8 points)

1 Answer

+6 votes
 
Best answer

You need to be catching exceptions when the user enters characters that will not parse to be an int type like "a", "15.2", but you don't need to catch the exception if the user enters an integer, but it is too large to store in an int location in memory or if the sum of their two ints is too large to store in an int location in memory.

answered by (4.4k points)
selected by
...