Contoh Program Sederhana Hitung Angsuran Peminjaman Dengan Pengulangan Menggunakan Eclipse
19ADM - sekarang saya akan membagikan source code program menghitung angsuran hutang dengan menggunakan aplikasi eclipse.
Berikut adalah source code nya :
Berikut ini adalah hasil consolenya.
Silakan kembangkan kreativitas kalian dan selamat mencoba, semoga artikel ini bermanfaat bagi anda.
Berikut adalah source code nya :
package object;
import java.text.DecimalFormat;
import java.io.*;
import java.util.Scanner;
public class AngsuranHutang {
private static Object tanyalagi;
public static void main(String[] args) {
//untuk menampilkan nama dengan spasi
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
//untuk menginputkan suatu huruf atau bilangan
Scanner in = new Scanner(System.in);
//membuat dua angka di belakang koma
DecimalFormat digit = new DecimalFormat("0.00");
int lama;
String nama = "";
String tanya;
String tanyalagi;
double hutang;
double bunga;
double bunga1;
double angsur;
double sisa;
double total = 0;
double bayar;
double totbunga = 0;
System.out.println();
System.out.println(" PROGRAM HITUNG ANGSURAN PEMINJAMAN");
System.out.println("=================================================");
System.out.print("Silahkan isi nama anda = ");
try {
nama = input.readLine();
} catch (IOException e){
System.out.println("Error!");
}
System.out.print("Besar Pinjaman = ");
hutang = in.nextInt();
System.out.print("Lama Angsuran (bulan) = ");
lama = in.nextInt();
System.out.println("=================================================");
for(int a=1;a<=lama;a++) {
angsur=hutang/lama;
sisa=hutang-angsur*a;
bunga=hutang/(sisa+angsur);
bunga1=(bunga*hutang)/100;
bayar=bunga1+angsur;
total+=bayar;
totbunga+=bunga1;
System.out.println();
System.out.println("Bulan ke-" + a);
System.out.println("--------------------------------------------");
System.out.println("Suku bunga = " + digit.format(bunga) + "%");
System.out.println("Besar bunga = Rp " + digit.format(bunga1));
System.out.println("Bayar = Rp " + digit.format(bayar));
System.out.println("Sisa Pinjaman = Rp " + digit.format(sisa));
System.out.println("--------------------------------------------");
}
System.out.println();
System.out.println("=================================================");
System.out.println("Nama peminjam = " +nama);
System.out.println("Pinjaman awal = Rp " +hutang);
System.out.println("Total bunga = Rp " +digit.format(totbunga));
System.out.println("Total (termasuk bunga) = Rp " +digit.format(total));
System.out.println("=================================================");
System.out.println();
//Looping
System.out.print("Apakah Data sudah benar (y/t) : ");
tanya = in.next();
if (tanya.equalsIgnoreCase("y")){
Terimakasih();
}
else {
ulang();
}
}
private static void Terimakasih(){
System.out.println();
System.out.println("=================================================");
System.out.println(" TERIMAKASIH");
System.out.println("=================================================");
}
private static void ulang(){
Scanner in = new Scanner(System.in);
System.out.print("Apakah ingin di ulang? (y/t) : ");
AngsuranHutang.tanyalagi = in.next();
if (((String) tanyalagi).equalsIgnoreCase("y")){
main(null);
}
else {
Terimakasih();
}
}
}
import java.text.DecimalFormat;
import java.io.*;
import java.util.Scanner;
public class AngsuranHutang {
private static Object tanyalagi;
public static void main(String[] args) {
//untuk menampilkan nama dengan spasi
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
//untuk menginputkan suatu huruf atau bilangan
Scanner in = new Scanner(System.in);
//membuat dua angka di belakang koma
DecimalFormat digit = new DecimalFormat("0.00");
int lama;
String nama = "";
String tanya;
String tanyalagi;
double hutang;
double bunga;
double bunga1;
double angsur;
double sisa;
double total = 0;
double bayar;
double totbunga = 0;
System.out.println();
System.out.println(" PROGRAM HITUNG ANGSURAN PEMINJAMAN");
System.out.println("=================================================");
System.out.print("Silahkan isi nama anda = ");
try {
nama = input.readLine();
} catch (IOException e){
System.out.println("Error!");
}
System.out.print("Besar Pinjaman = ");
hutang = in.nextInt();
System.out.print("Lama Angsuran (bulan) = ");
lama = in.nextInt();
System.out.println("=================================================");
for(int a=1;a<=lama;a++) {
angsur=hutang/lama;
sisa=hutang-angsur*a;
bunga=hutang/(sisa+angsur);
bunga1=(bunga*hutang)/100;
bayar=bunga1+angsur;
total+=bayar;
totbunga+=bunga1;
System.out.println();
System.out.println("Bulan ke-" + a);
System.out.println("--------------------------------------------");
System.out.println("Suku bunga = " + digit.format(bunga) + "%");
System.out.println("Besar bunga = Rp " + digit.format(bunga1));
System.out.println("Bayar = Rp " + digit.format(bayar));
System.out.println("Sisa Pinjaman = Rp " + digit.format(sisa));
System.out.println("--------------------------------------------");
}
System.out.println();
System.out.println("=================================================");
System.out.println("Nama peminjam = " +nama);
System.out.println("Pinjaman awal = Rp " +hutang);
System.out.println("Total bunga = Rp " +digit.format(totbunga));
System.out.println("Total (termasuk bunga) = Rp " +digit.format(total));
System.out.println("=================================================");
System.out.println();
//Looping
System.out.print("Apakah Data sudah benar (y/t) : ");
tanya = in.next();
if (tanya.equalsIgnoreCase("y")){
Terimakasih();
}
else {
ulang();
}
}
private static void Terimakasih(){
System.out.println();
System.out.println("=================================================");
System.out.println(" TERIMAKASIH");
System.out.println("=================================================");
}
private static void ulang(){
Scanner in = new Scanner(System.in);
System.out.print("Apakah ingin di ulang? (y/t) : ");
AngsuranHutang.tanyalagi = in.next();
if (((String) tanyalagi).equalsIgnoreCase("y")){
main(null);
}
else {
Terimakasih();
}
}
}
Berikut ini adalah hasil consolenya.
Silakan kembangkan kreativitas kalian dan selamat mencoba, semoga artikel ini bermanfaat bagi anda.
loading...
DONASI MELALUI SEMUA WALLET BANK
Bantu berikan donasi jika artikelnya dirasa bermanfaat. Donasi akan digunakan untuk memperpanjang domain www.19adm.com. Terima kasih.
Silakan Berikan Komentar Anda
BalasHapus- Komentar dengan sopan
- Dilarang spam Komentar
- Dilarang memberikan link aktif pada kolom komentar
- Dilarang menggunakan Kosa Kata yang Kasar atau Negatif
Salam Hangat
AriefDM
This product is meant to be used by these 21 or older for amusement purposes only. Practice or success at social on line casino gaming does not suggest future success at real money gambling. Companies like IGT, Aristocrat and WMS pumped out video games with movie, television and superstar tie-ins. Yet if they do not overlap the goal demographic like "Wheel of Fortune", "Sex in the City" or "Monopoly" did, then they do not do nicely. The slot machines in the fuel station 퍼스트카지노 are variety of the} hottest in the state, but employees can’t gamble in their office, so Bain performs slots at different locations round town. Randy St. Clair and Randall Bain stated they didn’t gamble a lot until the slot machines confirmed up in their hometown of Marion, Illinois.
BalasHapus