Assignment6.docx - Sydni Tanner ISYS 350 Assignment 6 Part One private void button1_Click(object sender EventArgs e cfw dataGridView1.ColumnCount = 4

Assignment6.docx - Sydni Tanner ISYS 350 Assignment 6 Part...

This preview shows page 1 - 3 out of 6 pages.

Sydni Tanner ISYS 350 Assignment 6 Part One private void button1_Click( object sender, EventArgs e) { dataGridView1.ColumnCount = 4; dataGridView1.Columns[0].HeaderText = "Year" ; dataGridView1.Columns[1].HeaderText = "Value at Beginning of Year" ; dataGridView1.Columns[2].HeaderText = "Depreciation During Year" ; dataGridView1.Columns[3].HeaderText = "Total Depreciation to End of Year" ; double propertyValue, propertyLife, depreciation, totalDepreciation = 0; propertyValue = double .Parse(textBox1.Text); propertyLife = double .Parse(textBox2.Text); dataGridView1.Rows.Clear(); for ( int year = 1; year <= propertyLife; year++) { dataGridView1.Rows.Add(); if (year < propertyLife) depreciation = (propertyValue) * 2 / propertyLife; else depreciation = propertyValue; dataGridView1.Rows[year - 1].Cells[0].Value = year; dataGridView1.Rows[year - 1].Cells[1].Value = propertyValue.- ToString( "C" ); dataGridView1.Rows[year - 1].Cells[2].Value = depreciation.ToString( "C" ); totalDepreciation += depreciation; dataGridView1.Rows[year - 1].Cells[3].Value = totalDepreciation.- ToString( "C" ); propertyValue -= depreciation; } }
Image of page 1
Part Two using Microsoft.VisualBasic;
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 6 pages?

  • Fall '10
  • LI
  • Depreciation, 6 months, 48 months, Sydni Tanner

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture