namespace WindowsFormsApplication1 { public partial class Form1 : Form { public int [,] array = new int[2, 2]; // create a 2d array [0,0] to [1,1] public int[] totalsArray = new int[2]; // create a 1d array [0] to [1] public Form1() { array[0, 0] = 50; //amsterdamn infant array[0, 1] = 100; // amsterdamn kid array[1, 0] = 60; // frane infant array[1, 1] = 120; // france kid totalsArray[0] = 0; // Number of infants = 0 totalsArray[1] = 0; // Number of kids = 0 InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { destination.Enabled = false; // disable destination so they cant change after adding 1 person //set totals array for selected person to the number typed into number of box totalsArray[person.SelectedIndex] = int.Parse(numberofpeople.Text); //set the labels to show whats happened infantsNumber.Text = totalsArray[0].ToString(); // infants = [0] + got to use toString(0 to convert from int to stringas its a textfield) KidsNumber.Text = totalsArray[1].ToString(); // kids = [1] + got to use toString(0 to convert from int to stringas its a textfield) int infantTotalPrice = totalsArray[0] * array[destination.SelectedIndex, 0]; int kidTotalPrice = totalsArray[1] * array[destination.SelectedIndex, 1]; int totalTotal = infantTotalPrice * kidTotalPrice; totalPrice.Text = infantTotalPrice.ToString(); } } }