Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- periodYear pdYear = new periodYear();
- periodMon pdMon = new periodMon();
- pdYear.depSumma();
- pdMon.depSumma();
- }
- }
- class periodYear {
- String a = "Прибыльность вклада составит: ";
- int mon = 12;
- float telo = 50000;
- float pr = 20.4f;
- float percent;
- public void depSumma() {
- percent = telo * pr / 100;
- System.out.println(a + percent + " гривен. При условии начисления процентов по вкладу в конце срока.");
- }
- }
- class periodMon extends periodYear {
- public float pr = 19.8f;
- float tekSumma;
- int mes;
- @Override
- public void depSumma() {
- for (mes = 0; mes < 12; mes++) {
- percent = telo * pr / 100 / mon;
- telo = percent + telo;
- tekSumma = percent *= mes;
- }
- System.out.println(a + tekSumma + " гривен. При условии начисления процентов по вкладу в конце каждого месяца и пополнения ими же существующего вклада.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment