Вы находитесь на странице: 1из 1

#include <iostream.

h>
#include <iomanip.h>
using namespace std;
double SimpananAkhir(long tawal, int bulan, double bunga)
{
double nilaibunga = tawal*bulan*(bunga/100)/12;
return tawal+nilaibunga;
}
int main()
{
long tawal; int bulan; double bunga;
cout << "Program Menghitung Nilai Simpanan Bank" << endl;
cout << "======================================" << endl;
cout << "Masukkan Tabungan awal anda : Rp."; cin >> tawal;
cout << "Masukkan waktu simpanan (bln) : "; cin >> bulan;
cout << "Masukkan bunga (%) : "; cin >> bunga;
cout << endl;
cout << "Nilai Simpanan Anda setelah " << bulan << " bulan adalah" << endl;
cout << "Rp." << setiosflags(ios::fixed) << setprecision(2) << SimpananAkhir
(tawal,bulan,bunga) << endl;
}