MCC - CIS162AD
CS4 Employee Pay Calculator - 20 points
   cs.gif

This program will be used by employees to determine what their weekly net pay would be based on their hourly rate and number of hours worked.

Sample Form:

Requirements:

Pseudocode for calculate button:
//CS4 by Your Name - CIS162AD

namespace CS4
{
  public partial class frmCS4 : Form
  {
     public frmCS4()
     {
         InitializeComponent();
     }

     //Declare class level variables (employee count and total netpay) 
     //Declare class level constants (see list above) 
     
     private void btnCalculate_Click(object sender, System.EventArgs e) 
     { 
         // declare method variables 
         
         //Use nested try-catch blocks to get the input values 
         //so we know which one caused the error 
        try 
        { 
            //Get hours worked from textbox 
            try 
            { 
                 //Get pay rate from textbox 
            
                 //Calculate gross amount 
                 //Calculate taxes 
                 //Calculate net pay 

                 //Accumulate summary values 
                 //Calculate average net pay 

                 //Display results of calculations and summary values
             }
             catch (FormatException err) 
             { 
                  MessageBox.Show("Pay Rate must be numeric. " + err.Message, 
                    "Data Entry Error", MessageBoxButtons.OK, 
                    MessageBoxIcon.Exclamation); 
                  txtRate.SelectAll(); 
                  txtRate.Focus(); 
             }
         }
         catch (FormatException err) 
         {  
             MessageBox.Show("Hours worked must be numeric. " + err.Message, 
               "Data Entry Error", MessageBoxButtons.OK, 
               MessageBoxIcon.Exclamation); 
             txtHours.SelectAll(); 
             txtHours.Focus();
         } 
         catch (Exception err) 
         {
		 MessageBox.Show("Unexpected Error: " + err.Message);
         }
    }//end method 
     
	 
    private void btnClearForm_Click(object sender, EventArgs e)
    {
        //Use Clear or null string "" for TextBoxes, but
        //only use null string "" for Labels

 
        //Reset Accumulators
    }
	
	
    private void btnExit_Click(object sender, EventArgs e)
    {
          this.Close();
    }
		
		
  }//end of class
}//end of namespace	
Submit CS4Form.cs and CS4Form.Designer.cs


Revised: 09/23/2011 - www.mesacc.edu/~marquez/cis162ad/cs4_pay_calculator.html