A
Amanda
Can anyone help me to display the output in MessageBox for the
following program result?
--------------------------------------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
namespace A2_CISP40506F
{
class A2
{
static void Main(string[] args)
{
double p = 1000;
double r = .05, interest = 0;
double a = 0;
Console.WriteLine("Year\tAmount On Deposit\tInterest");
for (int year = 1; year <= 100; year++)
{
interest += a * r;
a = p + a * (1 + r);
Console.WriteLine("{0}\t{1:C}\t\t{2:C}", year, a,
interest);
}
}
} // class A2
}
following program result?
--------------------------------------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
namespace A2_CISP40506F
{
class A2
{
static void Main(string[] args)
{
double p = 1000;
double r = .05, interest = 0;
double a = 0;
Console.WriteLine("Year\tAmount On Deposit\tInterest");
for (int year = 1; year <= 100; year++)
{
interest += a * r;
a = p + a * (1 + r);
Console.WriteLine("{0}\t{1:C}\t\t{2:C}", year, a,
interest);
}
}
} // class A2
}