Click here to Skip to main content
16,020,162 members
Home / Discussions / C#
   

C#

 
AnswerRe: Response redirect paramters concatenating Pin
Ennis Ray Lynch, Jr.13-Jul-06 11:02
Ennis Ray Lynch, Jr.13-Jul-06 11:02 
GeneralRe: Response redirect paramters concatenating Pin
leckey13-Jul-06 11:07
leckey13-Jul-06 11:07 
QuestionSending Email with Attachment from Winform App Using Default Client Pin
smcneese13-Jul-06 10:07
smcneese13-Jul-06 10:07 
AnswerIf you don't want to use the API Pin
Ennis Ray Lynch, Jr.13-Jul-06 10:17
Ennis Ray Lynch, Jr.13-Jul-06 10:17 
GeneralRe: If you don't want to use the API Pin
smcneese13-Jul-06 10:38
smcneese13-Jul-06 10:38 
GeneralThe server settings Pin
Ennis Ray Lynch, Jr.13-Jul-06 11:00
Ennis Ray Lynch, Jr.13-Jul-06 11:00 
AnswerRe: Sending Email with Attachment from Winform App Using Default Client Pin
Josh Smith13-Jul-06 11:20
Josh Smith13-Jul-06 11:20 
QuestionCalculation Ouput Pin
Skanless13-Jul-06 9:35
Skanless13-Jul-06 9:35 
I am new to C# and have a class project to work on. I am trying to create an Amortization calulator the display the payment results based on the Time period thay have to repay the loan. The calculation part of it is working fine but I can not get it to display the result. Can I please get some help with this? See code Below:


<script runat="server">

protected void Button1_Click(object sender, EventArgs e)
{
Label6.Text = "Final Balance: " +
CalculateBalance(Convert.ToInt32(TextBox1.Text),
(Convert.ToDouble(TextBox2.Text) / 100),
Convert.ToInt32(TextBox3.Text),
Convert.ToInt16(DropDownList1.SelectedItem.Value)).ToString();



}

private string CalculateBalance(int Principal, double Rate, int Years, int Period)
{
double result;
double NumToBeRaised = (1 + Rate / Period);
result=Principal * System.Math.Pow(NumToBeRaised, (Years * Period));
return (result.ToString("C"));
}

private string AmortDisplay(double Principal, double results, int Years, int Period)

{

int AmortTime;
double AmortPayment;
double RemBalance;
string Output;


AmortTime = (Years * Period);
AmortPayment = (results / AmortTime);
RemBalance = -(Principal - AmortPayment);



TextBox4.Text = "Duration\t \tPayment\t \tRemaining Balance \n" + AmortTime + "\t\t" + Convert.ToString(AmortPayment) + "\t\t" + Convert.ToString(RemBalance) + "\n";


}





protected void Button2_Click(object sender, EventArgs e)
{

AmortDisplay(Convert.ToDouble(TextBox1.Text),
Convert.ToDouble(Label6.Text),
Convert.ToInt32(TextBox3.Text),
Convert.ToInt16(DropDownList1.SelectedItem.Value)).ToString();

}

</script>


Greg

The Belizean Dan Dada!!!
AnswerRe: Calculation Ouput Pin
Josh Smith13-Jul-06 10:27
Josh Smith13-Jul-06 10:27 
AnswerRe: Calculation Ouput Pin
cje13-Jul-06 11:52
cje13-Jul-06 11:52 
AnswerRe: Calculation Ouput Pin
Rob Graham13-Jul-06 12:12
Rob Graham13-Jul-06 12:12 
AnswerRe: Calculation Ouput Pin
Guffa13-Jul-06 12:15
Guffa13-Jul-06 12:15 
QuestionDuplicating the contents of a treeView Pin
AngryC13-Jul-06 9:30
AngryC13-Jul-06 9:30 
AnswerRe: Duplicating the contents of a treeView Pin
Ennis Ray Lynch, Jr.13-Jul-06 9:38
Ennis Ray Lynch, Jr.13-Jul-06 9:38 
GeneralRe: Duplicating the contents of a treeView Pin
AngryC13-Jul-06 9:47
AngryC13-Jul-06 9:47 
AnswerRe: Duplicating the contents of a treeView Pin
BoneSoft13-Jul-06 9:57
BoneSoft13-Jul-06 9:57 
QuestionTextBox Array in C#.NET Pin
orentuil13-Jul-06 9:18
orentuil13-Jul-06 9:18 
AnswerRe: TextBox Array in C#.NET Pin
Josh Smith13-Jul-06 9:23
Josh Smith13-Jul-06 9:23 
GeneralRe: TextBox Array in C#.NET Pin
orentuil13-Jul-06 9:54
orentuil13-Jul-06 9:54 
Questionsaving color in databse and retring Pin
_tasleem13-Jul-06 9:16
_tasleem13-Jul-06 9:16 
AnswerRe: saving color in databse and retring Pin
BoneSoft13-Jul-06 9:51
BoneSoft13-Jul-06 9:51 
GeneralUse the Int32 constructor Pin
Ennis Ray Lynch, Jr.13-Jul-06 10:19
Ennis Ray Lynch, Jr.13-Jul-06 10:19 
GeneralRe: saving color in databse and retring Pin
Josh Smith13-Jul-06 10:28
Josh Smith13-Jul-06 10:28 
GeneralRe: saving color in databse and retring Pin
BoneSoft13-Jul-06 11:35
BoneSoft13-Jul-06 11:35 
GeneralRe: saving color in databse and retring Pin
Josh Smith13-Jul-06 16:53
Josh Smith13-Jul-06 16:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.