Question: You will create a word processing document and create a psuedocode solution to the following problem. The code in the pseudocode on the following page

You will create a word processing document and create a psuedocode solution to the following problem.

The code in the pseudocode on the following page contains two methods, main() and retrieveProdName(num n) . The main() method calls the retrieveProdName() method using a number read from the users input at the keyboard. This psudocode design was implemented in Java, and deployed to the customers machines. But ocationally the program throws an InvalidPIDException and crashes. This is very disturbing to the customer, and they are demanding a fix. Your job is fix this problem.

First study the code to see how it work and determine where the exception can be thrown. Then copy the main() pseudocode (no need to copy the retrieveProdName() method as you will not be changing it) and apply a fix. The fix will consist of your using try and catch blocks to catch the exception. When the exception is caught print out a "Invalid Product Code, please try again" message, and then allow the program to continue normally.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!