Rowsyear 1Cells2Value C totalDepreciation depreciation

Rowsyear 1cells2value c totaldepreciation depreciation

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

dataGridView1.Rows[year - 1].Cells[2].Value = depreciation.ToString( "C" ); totalDepreciation += depreciation; dataGridView1.Rows[year - 1].Cells[3].Value = totalDepreciation.ToString( "C" ); value -= depreciation; } } } }
Image of page 2
using 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; using Microsoft.VisualBasic; namespace WindowsFormsApplication11 { public partial class Form2 : Form { public Form2() { InitializeComponent(); } private void button1_Click( object sender, EventArgs e) {
Image of page 3
dataGridView1.ColumnCount = 5; dataGridView1.Columns[0].HeaderText = "Payment#" ; dataGridView1.Columns[1].HeaderText = "Monthly Payment" ; dataGridView1.Columns[2].HeaderText = "Amount to Interest" ; dataGridView1.Columns[3].HeaderText = "Amount to Principal" ; dataGridView1.Columns[4].HeaderText = "Remanining Balance" ; double cost, downPayment, month, rate, monthlyPayment, interest, principal, loan, balance, sum; cost = double .Parse(textBox1.Text); downPayment = double .Parse(textBox2.Text); month = double .Parse(textBox3.Text); loan = cost - downPayment; balance = loan; sum = 0; if (radioButton1.Checked) { rate = .069; } else { rate = .085; } textBox4.Text = rate.ToString( "P" ); monthlyPayment = Financial .Pmt(rate / 12, month, -balance); dataGridView1.Rows.Clear(); for ( int counter=1;counter<= month;counter++) { dataGridView1.Rows.Add(); dataGridView1.Rows[counter - 1].Cells[0].Value = counter; dataGridView1.Rows[counter - 1].Cells[1].Value = monthlyPayment.ToString( "C" ); interest = Financial .IPmt(rate/12, counter, month, -loan);
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
  • Depreciation, 6 months, private void, private void button1_Click, 48 months

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture