this is a question for my school work i dont want the complete answer but how i should go about doing each part or help clarifying what the question is asking for
In the following method, the call to
getCreditCardNumber()may throw anInvalidLengthException, aNonNumericExceptionor anInvalidCardNumberException. Modify the method to do the following:
a. Catch theInvalidLengthExceptionand print the message “Card number must be 16 digits.”
b. Catch theNonNumericExceptionand print the message “Card number must be numbers only.”
c. Pass theInvalidCardNumberExceptionon to the calling method. In other words, don’t catch it, but let any calling method that uses this method know that it may throwInvalidCardNumberException.
public void getOrderInformation()
{
getCreditCardNumber();
}