Midterm Practical - F

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

PROG1125 – F23 – Midterm Exam Practical

Variant F

Objective:

Complete the following exercise as part of the midterm exam for PROG1125.

Time Limit: Remaining time until end of scheduled session.

Once completed upload the following (as per usual assignment hand-ins) to the dropbox under
evaluations->exams->midterm on d2l. All objects must be uploaded as separate items top the dropbox.

1. PDF Print-out of code containing all relevant logic and controls


2. Screen capture of GUI
3. Zipped file containing the project folder (folder with solution and all contents therein).

Exercise:

1. Create a windows form program (1)


2. In that program include the following (12)
Object Purpose Specific
One Buttons User control – event creation The text should read
‘Calculate’
Two textboxes User input on GUI Their names should not be
default names
Two radio buttons To select logic One named “rbSubtract”
one named “rbMultiply” –
their text should read:
“Subtract”, and “Multiply”
respectively.
One label Holds result of program Your math outputs to this
labels text. Name it
“lblOutput”
One label Holds your name. Name this “lblAuthor”
3. The program behaves as follows:
a. The user can select either radio button. Using an if statement control the following:
i. When they select Subtract radio button: we will subtract the numbers (4)
Hint: if statement for rbSubtract.checked

ii. When they select Multiply radio button: we will multiply the numbers. (4)
Hint: if statement for rbMultiply.checked

b. When the calculate button is pressed:


i. Perform the correct math on the inputs based on the radio button. (3)
ii. The output is calculated and then stored in the labels text field. (4)
E.g lblOutput.Text
iii. Change lblAuthor label text to read your first and last initial + the day of the
month it is x 3 (1)
E.g WW51 (for Oct 17)

You might also like