charlieharper
Expert Member
I'm quite new to the programming world, but after doing tons of research, I thought of learning C#.
I wrote (atleast trying
to) a simple Command prompt calculator that can automatically calculate Compunded Rent, with the Formula A=P(1+I)^N .
This is my Code so far, although I dont really get what Error 'P' is a 'variable' but is used like a 'method' means
Thanks
I wrote (atleast trying
This is my Code so far, although I dont really get what Error 'P' is a 'variable' but is used like a 'method' means
Code:
//namespace Interest
using System;
public class Interest
{
public static void Main(string[] args)
{
int A; //Amount
int P; //Price
int I; //Interest
int N; //Time
Console.Write("Price of the Purchase: ");
//P
P = Convert.ToInt32(Console.ReadLine());
Console.Write("Current Interest Rate: ");
//I
I = Convert.ToInt32(Console.ReadLine());
Console.Write("Installments in Years: ");
//n
N = Convert.ToInt32(Console.ReadLine());
A = P *(1 + I)^N; //Formula
Console.WriteLine("Amount Is: {0}", A =P * (1 + I) ^ N); //Formula
Console.Write("Did this Work? ");
A = Convert.ToInt32(Console.ReadLine());
}
}
Thanks