Question: Exception handling. The Convert.ToInt32 method requires a string argument that can be converted to an int. Write a GUI program called PlacingOrder in which you
Exception handling. The Convert.ToInt32 method requires a string argument that can be converted to an int. Write a GUI program called PlacingOrder in which you prompt the user for a stock number and quantity ordered using two textboxes. When the user clicks a button, the application accepts the strings the user entered and tries to convert them to integers. It also displays the values in a label (e.g., \"You entered stock #123 and quantity 3\".) Catch the specific type of Exception that is thrown when the user enters noninteger data for either field (if you are not sure what type of Exception it is, run the program and enter noninteger data and examine the exception). Within the catch block, display an error message (the error message should display in a label on the form) using the Exception's Message property, and set both the stock number and quantity values to O.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
