Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
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 (-499 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 (1 point)
selected by
...