Question: I'm needing some help with this C# program. I'm having trouble incorporating the necessary changes. The instructions and current code are below. The program enables

I'm needing some help with this C# program. I'm having trouble incorporating the necessary changes. The instructions and current code are below.

The program enables students to register for courses in a term of study. Students select

from a menu of courses for which they wish to register.

-The assumptions used by the program are:

Each course carries three credit hours.

The program terminates only when the student requires it.

-The program must follow these registration business rules:

No registration more than once for the same course.

No registration for more than nine credit hours (e.g., no more than three courses).

The program validates the user menu selection, and if valid, registers the student for the selected course. Otherwise, the program outputs an error message. The program then outputs the current list of registered classes. Additionally, the program should output the cumulative total credit hours the student has registered for thus far. You have been hired to complete the source code of this program by creating additional C# code in the button_Click() event hander according to these requirements:

Validate the user selection against the above business rules.

Output an error or a registration confirmation message based on your validation of user selection.

Update the total credit hours textbox if a registration is confirmed for a selected course.

Create additional (source) code.

A. Add required user interface components.

1. Code Variables: Code the required user interface (UI) variables ensuring that variables are defined with proper conventions. 2. Boolean Logic: Implement Boolean statements using proper Boolean logic. 3. Map User Input: Collect appropriate user input and map it properly to branching operations. 4. Create UI Code: Create user interface (UI) code as required.

B. Implement the required mathematical component. 1. Program Math Variables: Code the required math variables ensuring tha t variables are defined with proper conventions. 2. Program Math Operations: Program the required math operations with no syntax or computation errors. 3. Program Math Methods: Create the method(s) required to support the mathematical component.

C. Implement the library component as described in the software requirements. 1. Create Variables: Create additional variables and associated C# code to support the software requirements, ensuring the variables are defined with proper conventions. 2. Add Branching: Add additional branching code to support flow control. 3. Program Library Component: Program the required math operations related to the library component. 4. Incorporate Logic Operators: Incorporate the required logic operators to support the library component.

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows;

using System.Windows.Controls;

using System.Windows.Data;

using System.Windows.Documents;

using System.Windows.Input;

using System.Windows.Media;

using System.Windows.Media.Imaging;

using System.Windows.Navigation;

using System.Windows.Shapes;

namespace WPFRegisterStudent

{

///

/// Interaction logic for MainWindow.xaml

///

public partial class MainWindow : Window

{

Course choice;

public MainWindow()

{

InitializeComponent();

}

private void Window_Loaded(object sender, RoutedEventArgs e)

{

Course course1 = new Course("IT 145");

Course course2 = new Course("IT 200");

Course course3 = new Course("IT 201");

Course course4 = new Course("IT 270");

Course course5 = new Course("IT 315");

Course course6 = new Course("IT 328");

Course course7 = new Course("IT 330");

this.comboBox.Items.Add(course1);

this.comboBox.Items.Add(course2);

this.comboBox.Items.Add(course3);

this.comboBox.Items.Add(course4);

this.comboBox.Items.Add(course5);

this.comboBox.Items.Add(course6);

this.comboBox.Items.Add(course7);

this.textBox.Text = "";

}

private void button_Click(object sender, RoutedEventArgs e)

{

choice = (Course)(this.comboBox.SelectedItem);

this.listBox.Items.Add(choice);

// TO DO - Create code to validate user selection (the choice object)

// and to display an error or a registation confirmation message accordinlgy

// Also update the total credit hours textbox if registration is confirmed for a selected course

}

namespace WPFRegisterStudent

{

class Course

{

private string name = "";

private bool isRegisteredAlready = false;

public Course(string name)

{

this.name = name;

}

public void setName(string name)

{

this.name = name;

}

public string getName()

{

return name;

}

public bool IsRegisteredAlready()

{

return isRegisteredAlready;

}

public void SetToRegistered()

{

isRegisteredAlready = true;

}

public override string ToString()

{

return getName();

}

}

}

//XAML

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

xmlns:local="clr-namespace:WPFRegisterStudent"

mc:Ignorable="d"

Title="WPF Register Student " Height="395.902" Width="525" Loaded="Window_Loaded">

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!