Practical 4
Chapter 3: P r o c e s s i n g
Data
Submission guidelines:
• Keep the HCI principles in mind when designing your GUI.
• Make sure to use “save all” when you save your project.
• Make sure that you provide the name, number and your student
number for each program, e.g. Prac4 _Surname_12345678
• After completing all projects, combine ALL projects in the same
folder.
• Zip only the ONE folder before you submit the practical on eFundi.
Practical 4
Scenario: You are creating an application to help users calculate the area and circumference
of a circle, and the volume of a sphere based on a given radius.
Instructions: Create a Windows form application (.NET Framework) called Prac4
_Surname_12345678.
Form Design:
• The main form of the application should display the necessary controls and GUI fine
tuning as shown in the output example provided, as well as the instructions below.
• Form colour must be set to a system colour: ActiveCaption
• GroupBoxes colour must be set to a system colour: ActiveBorder
Functionality:
1. Calculate button:
• In the event that the "Calculate" button is clicked, the application must:
• Retrieve the radius as provided by the user.
• Use the appropriate datatype for the variables.
• Use the following formulas to calculate the required values (Use the
appropriate math class constants and methods and order of operations etc.):
o Circle Area: π * r²
o Circle Circumference: 2 * π * r
o Sphere Volume: (4/3) * π * r³
• Display the results in the appropriate Labels, formatting the output to show 2
decimal places.
2. Clear button: In the event that the "Clear" button is clicked, the application must:
• Clear all the TextBoxes and the output Labels.
• Return the applications focus to the radius textbox.
3. Exit button: In the event that the "Exit" button is clicked, the form must:
• close.
4. When the form is in runtime
• Focus must first be on the Radius textbox.
• The user must be able to enter the radius in the textbox, then press on the tab
key of their keyboard (only once) and immediately, focus must be on the
Calculate button, if the user presses the tab key for a second time, focus should
then go to the Clear button and if the user presses the tab key for a third time,
focus must be on the Exit button.
NB: Always remember that using comments is crucial, as is HCI compliance, the correct use
of naming conventions for controls and exception handling.
Study the output example to see exactly what your output is expected to look like:
Design Time:
Run Time:
How to submit:
• Zip (compress) the assignment folder as per the instructions on eFundi.
• Submit the .zip as folder as per the instructions on eFundi.