ISYS 350 Assignment 6 - private void button1_Click(object sender EventArgs e cfw dataGridView1.ColumnCount = 4 dataGridView1.Columns[0.HeaderText =\"Year

ISYS 350 Assignment 6 - private void button1_Click(object...

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

private void button1_Click( object sender, EventArgs e) { dataGridView1.ColumnCount = 4; dataGridView1.Columns[0].HeaderText = "Year" ; dataGridView1.Columns[1].HeaderText = "Value at Begining of Year" ; dataGridView1.Columns[2].HeaderText = "Depreciation During Year" ; dataGridView1.Columns[3].HeaderText = "Total depreciation to End of Year" ; double value, life, depreciation, totalDepreciation = 0; value = double .Parse(textBox1.Text); life = double .Parse(textBox2.Text); depreciation = 2 * value / life; dataGridView1.Rows.Clear(); for ( int year = 1; year <= life; year++) { dataGridView1.Rows.Add(); dataGridView1.Rows[year - 1].Cells[0].Value = year; dataGridView1.Rows[year - 1].Cells[1].Value = value.ToString( "c" ); dataGridView1.Rows[year - 1].Cells[2].Value = depreciation.ToString(
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

  • Fall '10
  • LI
  • Depreciation, private void button1_Click

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes