02 | using System.Windows.Forms; |
04 | namespace WindowsFormsApp3 { |
05 | public partial class Form1 : Form { |
06 | public Form1( ) { InitializeComponent( ); } |
08 | private void Compute_Click( object sender, EventArgs e ) { |
09 | string presentval = PV.Text; |
10 | string interest = rate.Text; |
11 | string period = years.Text; |
12 | double futureVal = FV( presentval, interest, period ); |
13 | Microsoft.VisualBasic.Interaction.MsgBox( |
14 | "The future value is" + futureVal ); |
17 | public double FV( string PV, string i, string n ) { |
19 | result = 1 + double .Parse( i ) / 100; |
20 | result = Math.Pow( result, int .Parse( n ) ); |
21 | result = double .Parse( PV ) * result; |
|