Kemarin saya sudah jelaskan tentang membandingkan pinjaman amortisasi, kali ini saya akan membagikan pinjaman amortisasi dengan menggunakan pemrograman java, .
Ada difinisi lain yang menyebutkan
"Amortisasi adalah Non Notification Loan yaitu suatu prosedur akuntansi yang dengan cara bertahap mengurangi nilai biaya dan suatu aset dengan umur ekonomis yang terbatas atau aktiva tak berwujud lain melalui pembebanan secara berkala ke pendapatan."
Selamat mencoba, .
import java.util.Scanner;
public class LoanAmortizationSchedule {
public static void main(String[] iriahus) {
@SuppressWarnings("resource")
Scanner s = new Scanner(System.in);
System.out.print("Loan amount: ");
double amount = s.nextDouble();
System.out.print("Number of years: ");
int years = s.nextInt();
System.out.print("Annual interest rate: ");
double interest = s.nextDouble();
double balance = amount;
double principal;
double monthlyInterestRate = interest / 1200;
double monthlyPayment = (amount * interest / 1200) / (1 -
(1 / Math.pow(1 + interest / 1200, years * 12)));
double totalPayment = monthlyPayment * years * 12;
System.out.printf("\nMonthly payment: %4.2f\n", monthlyPayment);
System.out.printf("Total payment: %4.2f\n\n", totalPayment);
System.out.println("--------------------------------------------");
System.out.println(" # | Interest | Principal | Balance |");
System.out.println("--------------------------------------------");
for (int i = 1; i <= years * 12; i++) {
interest = monthlyInterestRate * balance;
principal = monthlyPayment - interest;
balance = balance - principal;
System.out.printf("%2d | %9.2f | %11.2f | %11.2f |\n", i,
interest, principal, balance);
}
}
}
Semoga bermanfaat, . .
0 Response to "Jadwal Pinjaman Amortisasi"
Post a Comment