I'm new to this C# programming and I have an assignment to do. We are creating an Amortization Report in Visual Basic 2010.
So far I have three input boxes (Principal, Interest Rate, and Term) and a Submit button. I have to convert those three input boxes to double types. How in the world do I do that? Please help.. Here's my code.
C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespaceAmorization_Schedule
{
publicpartialclassForm1 : Form
{
publicForm1()
{
InitializeComponent();
}
// This is the Principal : text. Not the textbox.privatevoidlabel1_Click(object sender, EventArgs e)
{
}
// This is the Interest Rate :. Not the textbox.privatevoidRate_Click(object sender, EventArgs e)
{
}
// This is the Term: . Not the textbox for it.privatevoidTerm_Click(object sender, EventArgs e)
{
}
// This is the Principal textbox. This is where you put principal amount.privatevoidprincipaltxt_TextChanged(object sender, EventArgs e)
{
}
// This is the Interest Rate textbox. Put the rate of your interest here.privatevoidtxtrate_TextChanged(object sender, EventArgs e)
{
}
// This is the Term textbox. The terms of your loan.privatevoidtxtterm_TextChanged(object sender, EventArgs e)
{
}
// This is the Submit button. privatevoidbtnsubmit_Click(object sender, EventArgs e)
{
double Rate = Convert.ToDouble(txtrate.Text);
double principal = Convert.ToDouble(txtprincipal.Text);
}
privatevoidForm1_Load(object sender, EventArgs e)
{
}
privatevoidlabel1_Click_1(object sender, EventArgs e)
{
}
}
}
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.
FroglegRank #1,020 · 1.9K reputationPosted Jan 23, 2011, 9:37 AM EST
dhru patel9 reputationPosted Jan 23, 2011, 3:46 PM EST
0
yeah sort of. except I won't have the Good Credit field and all those things.
0
Bryian TanRank #396 · 6.3K reputationPosted Jan 23, 2011, 6:05 PM EST
0
hi,
I see you converting it to double in your code. What exactly is the problem?
Convert.ToDouble(txtprincipal.Text);
0
FroglegRank #1,020 · 1.9K reputationPosted Jan 23, 2011, 8:19 PM EST
0
I think you need to complete your form first, that is a textbox or label for the equation answer. Then try and do some math and code - and if you have difficulty, then post questions
FroglegRank #1,020 · 1.9K reputationPosted Jan 23, 2011, 9:37 AM EST
http://www.amortization-calc.com/
dhru patel9 reputationPosted Jan 23, 2011, 3:46 PM EST
Bryian TanRank #396 · 6.3K reputationPosted Jan 23, 2011, 6:05 PM EST
I see you converting it to double in your code. What exactly is the problem?
Convert.ToDouble(txtprincipal.Text);
FroglegRank #1,020 · 1.9K reputationPosted Jan 23, 2011, 8:19 PM EST