COMP 2129 Advanced Object-Oriented Programming with C #
Week 10 – Lab Test # 3
Submission:
· Save your project as LabTest3_XX_999 where XX stands for the initials of your first and last name and 999 stands for the last 3 digits of your student number.
· Submit your file on Blackboard. For Blackboard submission: zip (compress) the project folder and submit the zipped folde
· Solution code must be submitted on time otherwise it will not be marked.
· You may be asked to explain your code during a Blackboard Collaborate live session before a grade will be assigned. If this happens you will need to prepare the following: your student ID, be able to share your computer screen during the session with me, be able to have an adequate quality audio and video so I can hear you and see you, be alone in the room while you are explaining your code.
Complete one of the following (choose one exercise from below and complete only one):
Exercise 1: Write a program that stores 50 random numbers in a file. The random numbers should be positive with the largest value being 1000. Store five numbers per line and 10 different lines. Use the Random class to generate the values. Include appropriate exception-handling techniques in your solution. When the application closes, locate the text file and verify its contents.
Exercise 2: Design an application that enables users to enter two values of type int. Write a method that retrieves the values and stores them and their products in separate structures. When designing the Windows application, you might allow the user to input the values in a TextBox and then retrieve and store the values in a ListBox. Their product could be stored in a separate ListBox. Your solution should include exception-handling techniques with a minimum of two catch clauses and a finally clause. Consider using your finally clause to prepare the GUI for the next set of values.