Assignment4 ISYS350 (2) - QUESTION http\/online.sfsu.edu\/dchao\/ISYS350A4F13.htm PART 1 using System using System.Collections.Generic using

Assignment4 ISYS350 (2) - QUESTION...

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

QUESTION: PART 1using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace WindowsFormsApplication7{public partial class Form1 : Form{public Form1(){InitializeComponent();}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, doubledepre, totalDepreciation = 0;value = double.Parse(textBox1.Text);life = double.Parse(textBox2.Text);dataGridView1.Rows.Clear();for (int year = 1; year <= life; year++){if (year < life){doubledepre = 2 * value / life;}else{doubledepre = value;
Background image
}dataGridView1.Rows.Add();dataGridView1.Rows[year - 1].Cells[0].Value = year;dataGridView1.Rows[year - 1].Cells[1].Value = value.ToString("c");
Background image
Image of page 3

You've reached the end of your free preview.

Want to read all 7 pages?

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

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture