form!:
using System.Text.RegularExpressions;
using static WinFormsApp1.AthleteInfo;

namespace WinFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void TrainingPlanComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            // Will check if the user has selected beginner training plan and this will not allow new input inside the CompetitionsEnteredTextBox.
            if (TrainingPlanComboBox.SelectedIndex == 0)
            {
                CompetitionsEnteredTextBox.Text = string.Empty;
                CompetitionsEnteredTextBox.Enabled = false;
            }
            // Otherwise it will allow input from the CompetitionsEnteredTextBox from SelectedIndex 1 and 2.
            else
            {
                CompetitionsEnteredTextBox.Enabled = true;
            }
        }
        private void SubmitBtn_Click(object sender, EventArgs e)
        {
            Console.WriteLine("Clicked");

            // Validate all fields before enabling submission
            if (ValidateInputs())
            {

                Athlete newAthlete = new Athlete(
                    AthleteNameTextBox.Text,
                    TrainingPlanComboBox.SelectedItem.ToString(),
                    double.Parse(CurrentWeightTextBox.Text),
                    CompetitionWeightCategoryComboBox.SelectedItem.ToString(),
                    CompetitionsEnteredTextBox.Text.Length > 0 ? int.Parse(CompetitionsEnteredTextBox.Text) : 0,
                    int.Parse(PrivateCoachingTextBox.Text)
                );

                Form2 DisplayWindow = new Form2(newAthlete);
                DisplayWindow.Show();
            }
        }

        // This reduces repetition in the code by defining a method that can be used for most validations.
        private bool IsNumeric(string input)
        {
            return double.TryParse(input, out _) || (string.IsNullOrWhiteSpace(input) && input.Trim().All(char.IsDigit));
        }
        // Where all the checks happen to determine if the user input is valid.
        private bool ValidateInputs()
        {
            if (string.IsNullOrWhiteSpace(AthleteNameTextBox.Text))
            {
                MessageBox.Show("Name is empty.");
                return false;
            }

            if (AthleteNameTextBox.Text.Any(char.IsDigit))
            {
                MessageBox.Show("Name contains numbers.");
                return false;
            }

            if (TrainingPlanComboBox.SelectedIndex == -1)
            {
                MessageBox.Show("No training plan was selected.");
                return false;
            }

            if (!IsNumeric(CurrentWeightTextBox.Text))
            {
                MessageBox.Show("Current weight in kilograms (kg) contains non-numeric characters.");
                return false;
            }


            if (CompetitionsEnteredTextBox.Text.Length > 0)
            {
                if (!IsNumeric(CompetitionsEnteredTextBox.Text))
                {
                    MessageBox.Show("Number of competitions entered this month contains non-numeric characters.");
                    return false;
                }
            }

            if (CompetitionsEnteredTextBox.Text.Length > 0 && Convert.ToInt32(CompetitionsEnteredTextBox.Text) > 2)
            {
                MessageBox.Show("Can not enter more than 2 competitions.");
                return false;
            }

            if (!IsNumeric(PrivateCoachingTextBox.Text))
            {
                MessageBox.Show("Number of hours private coaching contains non-numeric characters.");
                return false;
            }

            if (Convert.ToInt32(PrivateCoachingTextBox.Text) > 20)
            {
                MessageBox.Show("Can not have more than 20 hours private coaching per month.");
                return false;
            }

            return true; // All validations passed
        }
    }
}

form2:
using System;
using System.Windows.Forms;
using WinFormsApp1;
using static WinFormsApp1.AthleteInfo;

namespace WinFormsApp1
{
    public partial class Form2 : Form
    {
        private Athlete _athlete;
        public Form2(Athlete athlete)
        {
            InitializeComponent();
            _athlete = athlete;

        }
        // This is what happens when Form2 is loaded in order.
        private void Form2_Load(object sender, EventArgs e)
        {
            DisplayAthleteInfo();
            DisplayItemizedCosts();
            string WeightCategory = GetWeightCategory(_athlete.CurrentWeight);
            ActualWeightCategoryTextBox.Text = WeightCategory;
            SaveDataToFile();
        }
        private void DisplayAthleteInfo()
        {
            // Adds information to the listbox.
            AthleteListBox.Items.Add("Name: " + _athlete.Name);
            AthleteListBox.Items.Add("Training Plan: " + _athlete.TrainingPlan);
            AthleteListBox.Items.Add("Current Weight: " + _athlete.CurrentWeight.ToString());
            AthleteListBox.Items.Add("Competetion Weight Category: " + _athlete.CompetitionWeightCategory.ToString());
            AthleteListBox.Items.Add("Competitions Entered: " + _athlete.CompetitionsEntered.ToString());
            AthleteListBox.Items.Add("Private Coaching Hours: " + _athlete.PrivateCoachingHours.ToString());
        }

        public void DisplayItemizedCosts()
        {
            // Calculate costs based on athlete's choices and prices
            double weeklyFee = 0;
            double privateCoachingCost = _athlete.PrivateCoachingHours * 9.50; // £9.50 per hour
            double competitionCost = _athlete.CompetitionsEntered * 22.00; // £22.00 per competition

            string lowerCasePlan = _athlete.TrainingPlan.ToLower();
            switch (lowerCasePlan)
            {
                case var plan when plan.Contains("beginner"):
                    weeklyFee = 25.0; // £25.00 for Beginner plan
                    break;
                case var plan when plan.Contains("intermediate"):
                    weeklyFee = 30.0; // £30.00 for Intermediate plan
                    break;
                case var plan when plan.Contains("elite"):
                    weeklyFee = 35.0; // £35.00 for Elite plan
                    break;
                // Add more cases for other specific words/phrases in the training plan

                default:
                    break;
            }

            double totalWeeksInMonth = 4; // Assuming a month has 4 weeks for simplicity

            // Calculate total costs for the month
            double totalWeeklyFees = weeklyFee * totalWeeksInMonth;
            double totalCostForMonth = totalWeeklyFees + privateCoachingCost + competitionCost;

            // Display itemized costs in a ListBox
            CostsListBox.Items.Add($"Training Plan ({_athlete.TrainingPlan}) - Weekly Fee: £{weeklyFee.ToString("0.00")}");
            CostsListBox.Items.Add($"Private Coaching - Total Cost: £{privateCoachingCost.ToString("0.00")}");
            CostsListBox.Items.Add($"Competition Entry - Total Cost: £{competitionCost.ToString("0.00")}");
            CostsListBox.Items.Add($"Total Weekly Fees for the Month: £{totalWeeklyFees.ToString("0.00")}");
            CostsListBox.Items.Add($"Total Cost for the Month: £{totalCostForMonth.ToString("0.00")}");
        }

        Dictionary<string, double> weightCategories = new Dictionary<string, double>()
        {
            {"Flyweight", 66},
            {"Lightweight", 73},
            {"Light-Middleweight", 81},
            {"Middleweight", 90},
            {"Light-Heavyweight", 100},
            {"Heavyweight Unlimited", Double.PositiveInfinity}
        };

        private string GetWeightCategory(double weight)
        {
            foreach (var category in weightCategories)
            {
                if (weight <= category.Value)
                {
                    return category.Key;
                }
            }

            return "Weight not within defined categories";
        }

        private double CalculateTrainingPlanCost()
        {
            double trainingPlanCost = 0.0;

            switch (_athlete.TrainingPlan.ToLower())
            {
                case var plan when plan.Contains("beginner"):
                    trainingPlanCost = 25.0; // £25.00 for Beginner plan
                    break;
                case var plan when plan.Contains("intermediate"):
                    trainingPlanCost = 30.0; // £30.00 for Intermediate plan
                    break;
                case var plan when plan.Contains("elite"):
                    trainingPlanCost = 35.0; // £35.00 for Elite plan
                    break;
                default:
                    break;
            }
            return trainingPlanCost;
        }
        private void SaveDataToFile()
        {
            // Get the current directory of the application
            string appStartupPath = Application.StartupPath;
            // Update path
            string filePath = Path.Combine(appStartupPath, "athlete_data.txt");

            // Calculating costs
            int totalWeeksInMonth = 4;
            double weeklyFee = CalculateTrainingPlanCost();
            double PrivateCoachingCost = _athlete.PrivateCoachingHours * 9.50;
            double competitionCost = _athlete.CompetitionsEntered * 22.00;

            double totalWeeklyFees = weeklyFee * totalWeeksInMonth;
            double totalCostForMonth = totalWeeklyFees + PrivateCoachingCost + competitionCost;
            // This is the data that will be saved in the text file as a string.
            string dataToSave = $"Athlete Information:\nName: {_athlete.Name}\nTraining Plan: {_athlete.TrainingPlan}\nCurrent Weight: {_athlete.CurrentWeight}\nCompetitions Entered: {_athlete.CompetitionsEntered}\nPrivate Coaching Hours: {_athlete.PrivateCoachingHours}\n\n" +
                $"Costs for the Month:\nTraining Plan Cost: {weeklyFee:C}\nPrivate coaching Cost: {PrivateCoachingCost:C}\nCompetition Entry Cost: {competitionCost:C}\n\n" +
                $"Total Weekly Fees for the Month: {totalWeeklyFees:C}\nTotal Cost for the Month: {totalCostForMonth:C}\n" +
                $"Actual Weight Category: {GetWeightCategory(_athlete.CurrentWeight)}";

            try
            {
                // Append data to the file if it exists; create a new file if it doesn't exist
                using (StreamWriter writer = new StreamWriter(filePath, true))
                {
                    writer.Write("\n------------------------------------------\n\n");
                    writer.WriteLine(dataToSave);
                }

                MessageBox.Show("Data saved successfully at " + filePath);
            }
            // For when an error occurs when appending data
            catch (Exception ex)
            {
                MessageBox.Show($"Error appending data to file: {ex.Message}");
            }
        }
    }
}

athleteinfo:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WinFormsApp1
{
    public class AthleteInfo
    {
        public class Athlete
        {
            // Creates properties for the class athlete that may be used elsewhere.
            public string Name { get; set; }
            public string TrainingPlan { get; set; }
            public double CurrentWeight { get; set; }
            public string CompetitionWeightCategory {  get; set; }
            public int CompetitionsEntered { get; set; }
            public int PrivateCoachingHours { get; set; }

            // This constructor takes in parameters corresponding to each property
            // and assigns these values to the respective properties of the Athlete
            // object being instantiated.
            public Athlete(string name, string trainingPlan, double currentWeight, string competitionweightcategory,  int competitionsEntered, int privateCoachingHours)
            {
                Name = name;
                TrainingPlan = trainingPlan;
                CurrentWeight = currentWeight;
                CompetitionWeightCategory = competitionweightcategory;
                CompetitionsEntered = competitionsEntered;
                PrivateCoachingHours = privateCoachingHours;
            }
        }
    }
}


You are to write a report that details the process that would be required to design the
algorithm for the solution and how you turned the algorithm into a working application.
Your report should include the following.
● A definition, written in the design tool of your choosing, of the algorithm
required for the implementation of the North Sussex Judo program
● An outline of the steps required to build the application
● A description of the steps required for converting the algorithm into a working
program, including identification of a suitable programming language
● An explanation of the coding standards you used in your source code.
As part of your written report, you should clearly show how you have enhanced your
original algorithm, using the features of the IDE to manage the development process.
This could include:
● identifying and solving any logical errors in the original algorithm
● debugging any errors in the program
● using version control within your IDE to track and monitor changes in the
algorithm
● using performance monitoring tools to optimise the algorithm
● refining and optimising the algorithm using different code constructs.