Report on the Design and Development of the North Sussex Judo Program
Algorithm Definition
To implement the North Sussex Judo program, the following algorithm was designed:
- Initialize the application and load the form interface.
- Allow the user to input the athlete's information into the form fields, such as name, weight, chosen training plan, etc.
- Validate the user inputs to ensure accurate data is provided:
- Check if the name field contains only letters and is not empty.
- Verify that the weight, competitions entered, and private coaching hours are numeric and within the specified ranges.
- Disable or enable text fields based on the selection of the training plan in real-time.
- Upon clicking the "Submit" button, perform validation of all fields.
- If validation passes, construct an Athlete object with the provided input data.
- Open a new Form2 window and display the entered athlete information and calculated costs.
- Display the athlete's actual weight category based on the given weight.
- Save all displayed information to a text file, appending to existing data if the file already exists.
Steps to Build the Application
The process of building the application involved:
- Setting up a development environment with the required tools (IDE, .NET Framework, etc.).
- Creating a new Windows Forms Application project within the IDE.
- Designing the user interface (UI) with necessary controls (text boxes, labels, combo boxes, buttons, and list boxes).
- Writing the backend code to handle events such as button clicks and combo box selection changes.
- Implementing validation logic to ensure correct data is entered by the user.
- Designing the Athlete class with properties that map to the input data.
- Implementing the logic to calculate costs based on the athlete’s training plan, competitions entered, and private coaching hours.
- Writing code to display the data on Form2 and save the data to a file.
- Testing the application to ensure proper functionality.
- Making adjustments and refinements based on test results.
Converting the Algorithm to a Working Program
To convert the designed algorithm into a working program, the following steps were taken:
- The C# programming language was selected for its robustness and suitability for Windows Forms Applications.
- The designed algorithm was translated into C# code, and methods were established for validation (e.g.,
IsNumeric, ValidateInputs) and event handling (e.g., TrainingPlanComboBox_SelectedIndexChanged, SubmitBtn_Click).
- Logical flow controls such as
if statements and switch cases were implemented to handle different scenarios.
- Object-oriented programming principles were applied to create the
Athlete class, encapsulating the properties and data relevant to each athlete.
- Exception handling was implemented for file writing to handle any potential errors gracefully.
Coding Standards Used in Source Code
The source code adheres to the following coding standards:
- Descriptive variable and method names for clarity (e.g.
DisplayAthleteInfo, CompetitionsEnteredTextBox).
- Consistent naming conventions such as PascalCase for class names and methods, camelCase for variables.
- Proper indentation and spacing for better readability.
- Commenting to explain the purpose of complex blocks of code.
- Error checking and validation to prevent the application from executing with incorrect data.
- Use of object-oriented programming best practices, including encapsulation and separation of concerns.
Enhancements and Development Process Management
Throughout the development process, certain enhancements were made, and various features of the IDE were utilized:
- Logical Errors Identification and Solving: The logic was reviewed to ensure that enabling and disabling of input fields was correct based on the combo box selection.
- Debugging: The IDE's debugging tools helped identify runtime errors, especially in data validation and file input/output operations.
- Version Control: A version control system was used within the IDE to commit changes, allowing tracking of progress and reverting to previous code when necessary.
- Performance Monitoring: Although not performance-intensive, basic memory and CPU usage were monitored to ensure the application's efficiency.
- Refining and Optimizing: Code constructs such as LINQ expressions were used to simplify data processing, and loops were optimized to reduce complexity.
The application was developed incrementally, starting with basic functionality and gradually integrating additional components and features, ensuring robustness and user-friendliness in the final product.