Atem85

Deposit

Jul 15th, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.36 KB | None | 0 0
  1. public class Main {
  2.         public static void main(String[] args) {
  3.             periodYear pdYear = new periodYear();
  4.             periodMon pdMon = new periodMon();
  5.  
  6.             pdYear.depSumma();
  7.             pdMon.depSumma();
  8.         }
  9.  
  10. }
  11. class periodYear  {
  12.           String a = "Прибыльность вклада составит: ";
  13.  
  14.        
  15.             int mon = 12;
  16.                
  17.  
  18.                 float telo = 50000;
  19.                 float pr  = 20.4f;
  20.                 float percent;
  21.  
  22.             public void depSumma()  {
  23.  
  24.         percent = telo * pr / 100;
  25.         System.out.println(a + percent + " гривен. При условии начисления процентов по вкладу в конце срока.");
  26.  
  27.     }
  28.     }
  29. class periodMon extends periodYear {
  30.     public float pr = 19.8f;
  31.     float tekSumma;
  32.     int mes;
  33.  
  34.  
  35.     @Override
  36.     public void depSumma() {
  37.  
  38.  
  39.         for (mes = 0; mes < 12; mes++)  {
  40.             percent = telo * pr / 100 / mon;
  41.             telo = percent + telo;
  42.             tekSumma = percent *= mes;
  43.  
  44.         }
  45.             System.out.println(a + tekSumma + " гривен. При условии начисления процентов по вкладу в конце каждого месяца и пополнения ими же существующего вклада.");
  46.  
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment