i am trying to solve that assignment and this is what i have so far

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 CarInsurance
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            int driverAge;
            String stRes = "WI";
            const int BASEIL = 100;
            const int BASEWI = 50;
           

            try
            {
                driverAge = Convert.ToInt32(textBox1);
                stRes = Convert.ToString(textBox2);
                if (driverAge < 16 &&  driverAge > 80 || stRes != "WI" && stRes != "IL" )
                
                driverAge = (3*100) - driverAge;

            }
            catch (ArgumentException)
            {
                label3.Text = " ";
            
            }

            try
            {
                if(driverAge != "" )


            }

            catch(FormatException)
            {
                label3.Text = "Error":
            }
                

        }

        private void button1_Click(object sender, EventArgs e)
        {


        }
    }
}

I think it means you need to create a separate class named "CarInsurance" as per your instructions, and all it has in it is the two variables, and the function.

It will need to "throw" from inside the function, an ArgumentException, using "throw".

http://msdn.microsoft.com/en-us/library/1ah5wsex(v=vs.80).aspx
http://msdn.microsoft.com/en-us/library/system.argumentexception.aspx
:

throw new ArgumentException("Some error message", "someParamter");
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.