Advertisement
desislava_topuzakova

03. Deposit Calculator

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