Assignment 3.docx - Melissa Tang ISYS 350 02 Assignment 3 Part 1 namespace Assignment_3 namespace Assignment_3 public partial class Form1 Form public

Assignment 3.docx - Melissa Tang ISYS 350 02 Assignment 3...

This preview shows page 1 - 5 out of 5 pages.

Melissa Tang ISYS 350 - 02 Assignment 3: Part 1: namespace Assignment_3 namespace Assignment_3 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click( object sender, EventArgs e) { double hoursused, totalcost; hoursused = double .Parse(textBox1.Text); if (radioButton1.Checked) { if (hoursused <= 10) { totalcost = 12.95; } else { totalcost = 12.95 + (hoursused - 10) * 4; } } else if (radioButton2.Checked) { if (hoursused <= 20) { totalcost = 14.95; } else { totalcost = 14.95 + (hoursused - 20) * 2; } } else if (radioButton3.Checked) { if (hoursused <= 30) { totalcost = 20; } else { totalcost = 20 + (hoursused - 30) * 1; } } else { totalcost = 35.95; } if (checkBox1.Checked) { totalcost*=(1-0.2); } textBox2.Text = totalcost.ToString( "c" ); } private void textBox1_Validating( object sender, CancelEventArgs e) { try { double .Parse(textBox1.Text); e.Cancel = false ; } catch { e.Cancel = true ; MessageBox.Show( "The number of hours must contain digits only" ); } { double numberhours; numberhours = double .Parse(textBox1.Text); if (numberhours > 744) { MessageBox.Show( "The number of hours cannot exceed 744" );
Image of page 1
Melissa Tang ISYS 350 - 02 e.Cancel = true ; } } } } }
Image of page 2
Melissa Tang ISYS 350 - 02 Part 2: private void button1_Click( object sender, EventArgs e) { double salary, charge, insurance, retirement, compensation, FICA, total;
Image of page 3
Image of page 4
Image of page 5

You've reached the end of your free preview.

Want to read all 5 pages?

  • Fall '10
  • LI
  • Harry Connick, Jr., 2005 albums, April 16, private void button1, Melissa Tang

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture