Advertisement
desislava_topuzakova

03. Deposit Calculator

Oct 5th, 2020
882
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.82 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class RadiansToDegrees_02 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         //сума = депозирана сума  + срок на депозита * ((депозирана сума * годишен лихвен процент ) / 12)
  7.         //1.вход: депозирана сума(double), срок(int), процент(double)
  8.         //2. изчисляваме сумата
  9.         //3. отпечатваме
  10.         double depositSum = Double.parseDouble(scanner.nextLine());
  11.         int months = Integer.parseInt(scanner.nextLine());
  12.         double percent = Double.parseDouble(scanner.nextLine());
  13.  
  14.         double sum = depositSum + months * ((depositSum * (percent / 100)) / 12);
  15.         System.out.println(sum);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement