したがって、私はコーディングにかなり慣れていないため、代わりに 0 を返すだけです。実行時に 3 つの入力として 10000 5 と 10 を入力しましたが、3 つのフィールドすべてで 0 以外の値を返すことができません。私のプログラムが変数の開始点を必要としているのではないかと思ったので、それらをすべて 0 として宣言して開始しましたが、それでも機能しませんでした。
int AIR, MIR, PMT, IP, PP, ABorrowed, Term;
AIR = 0;
MIR = 0;
PMT = 0;
IP = 0;
PP = 0;
ABorrowed = 0;
Term = 0;
Console.WriteLine("Please enter the amount borrowed on your loan ");
ABorrowed = int.Parse(Console.ReadLine());
Console.WriteLine("Please enter the interest rate for your loan ");
AIR = int.Parse(Console.ReadLine());
Console.WriteLine("Please enter term of your loan in months ");
Term = int.Parse(Console.ReadLine());
MIR = AIR / 12;
PMT = ABorrowed * (MIR/((1-(1/(1+MIR))^Term)));
IP = ABorrowed * MIR;
PP = PMT - IP;
Console.WriteLine("Your total payment for this month is " + PMT);
Console.WriteLine("Of that payment " + IP + " is interest rate");
Console.WriteLine("and the Payment Portion is " + PP);
Console.ReadLine();