a. Th e Convert.ToInt32() method requires a string argument that can be converted to an int. Write a program in which you prompt the user for a stock number and quantity ordered. Accept the strings...


a. Th e Convert.ToInt32() method requires a string argument that can be converted to an int. Write a program in which you prompt the user for a stock number and quantity ordered. Accept the strings the user enters and convert them to integers. Catch the Exception that is thrown when the user enters noninteger data for either fi eld. Within the catch block, display an error message and set both the stock number and quantity values to 0. Save the fi le as PlacingOrder.cs. b. Modify the PlacingOrder application so that data entry is performed in a DataEntry() function that accepts a string parameter to use as a prompt. Th e function prompts the user, reads a value from the keyboard, attempts to convert it to an integer, and then returns the integer. If an Exception is encountered, the function should return 0. Save the fi le as PlacingOrder2.cs



May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here