namespace DanielGurr_FinalProject_10_5_2_
{
public partial class DG_MainForm : Form
{
int[] dgDormCostArray = { 1500, 1600, 1800, 2500 };
int[] dgMealPlanArray = { 600, 1200, 1700 };
string[] dgDormListArray = { "Allen Hall", "Pike Hall", "Farthing Hall", "University Suites" };
string[] dgMealPlanChoiceArray = { "7 meals per week", "14 meals per week", "Unlimited meals" };
int dgTotalPrice;
public DG_MainForm()
{
InitializeComponent();
}
private void DG_MainForm_Load(object sender, EventArgs e)
{
dgDormListBox.Items.Clear();
dgMealPlanListBox.Items.Clear();
for (int i = 0; i < dgDormListArray.Length; i++)
{
dgDormListBox.Items.Add(dgDormListArray[i].ToString());
}
for (int i = 0; i < dgMealPlanChoiceArray.Length; i++)
{
dgMealPlanListBox.Items.Add(dgMealPlanChoiceArray[i].ToString());
}
}
private void dgDisplayCostButton_Click(object sender, EventArgs e)
{
dgTotalPrice = 0;
dgTotalPrice = dgDormCostArray[dgDormListBox.SelectedIndex] + dgMealPlanArray[dgMealPlanListBox.SelectedIndex];
}
}
}