Exam 3 

 

using the form attached to Blackboard (or creating your own if you prefer), complete the following requirements to add a series of integers via the PowPow class to a collection and display the results in a list box on your form.

Sample Form:

 

The form has three text boxes for integers A, B, and C along with four buttons named ‘Add to List’,

‘Show Results’, ‘Clear List’, and ‘Close’.

General Requirements:

 The form should close if the user hits escape

 The form should try to add the values to the list if the user hits enter

 Null values and strings should not be allowed in the text boxes, therefore not added to the

collection

 Clearing the list should delete items from the list box AND the collection

 Create a PowPow Class and a PowPowCollection Module (more info below)

Add to List:

 This button will add the three integers to the PowPow Class, then add the object to the

PowPowCollection assuming all data is valid

 If the data is valid, a message box should appear saying the item was added to the collection

 If the data is not valid, a message box should appear stating there is an error

Continued on next page…

 

Show Results:

 If there is no data in the collection, a message box should appear stating the collection is empty

 If there is data, the results of the objects in the collection should appear in the list box using the  following string format:

A: # B: # C: # – A^B^C = result

 

Example:

 

Clear List:

 Clicking this button clears the list box AND the collection

 Clicking ‘Show Results’ after this should display a message stating the collection is empty

Close:

 Closes the form

PowPow Class:

Create a PowPow class with the following properties:

New() – Creates a new instance of a PowPow object

SetA() – Write only property that sets the value for A

SetB() – Write only property that sets the value for B

SetC() – Write only property that sets the value for C

getPowPow() – Read only property that gets the result for A^B^C

ToString() – Overrides the ToString method and returns a string that contains the values for A, B, C, and

the result in the format needed for the Show Result button above: A: # B: # C: # – A^B^C = result

 

 

PowPowCollection Module:

Create a PowPowCollection module that contains a collection and an AddPowPow procedure that adds a PowPow object to the collection.

The AddPowPow procedure should be public and accept a PowPow object as its parameter. Make sure that either the AddPowPow procedure or your form code catches any exceptions!

Sample Test Data:

 

 

 

 



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *