i am trying to solve this question, second part of it 5b
and is very confusing
i cant show all the details on the form on the form

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

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

        double[] myArray = new double[5];
        private void button1_Click(object sender, EventArgs e)
        { 
            try
            {
               
                myArray[0] = Convert.ToDouble(textBox1.Text);
                myArray[1] = Convert.ToDouble(textBox2.Text);
                myArray[2] = Convert.ToDouble(textBox3.Text);
                myArray[3] = Convert.ToDouble(textBox4.Text);
                myArray[4] = Convert.ToDouble(textBox5.Text);
                myArray[5] = Convert.ToDouble(textBox6.Text);
                myArray[6] = Convert.ToDouble(textBox7.Text);
                myArray[7] = Convert.ToDouble(textBox8.Text);
                myArray[8] = Convert.ToDouble(textBox9.Text);
                myArray[9] = Convert.ToDouble(textBox10.Text);

            }
            catch (Exception ex)
            {
                IDNum = 999;
                hourlyWage = 6.0;
                label6.Text = (ex.Message);
            }
            for (int i = 0; i < myArray.Length; i++)

            {
                label6.Text = ("Employee ID #  \t\t\t Employee Wage\n");
                    myArray[i].ToString();
            }
        }
                
       public class Employee
        {
            public int idNum = 999;
            public double hourlyrate  = 6;
           
            public Employee(int idNumber, double emprate)
            {
                idNum = idNumber;
                if (emprate < 6 || emprate > 50)
                {
                    throw new ArgumentException("Value does not fall within the expected range.");
                }
               else
                   hourlyrate = emprate;

                
            }
        }

        public double hourlyWage { get; set; }

        public int IDNum { get; set; }
    }
}

Why do yuo have an array for 5 doubles and 10 textboxes?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.