Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. package com.company;
  2.  
  3. public class Main {
  4.  
  5. public static void main(String[] args) {
  6. /*Задача 1*/
  7. sumAverage(4, 6, 2);
  8.  
  9. /*Задача 2*/
  10. sumSalary(1240);
  11.  
  12. /*Задача 3*/
  13. sumLoan();
  14. }
  15.  
  16. public static void sumAverage(int number1,int number2, int number3){
  17. /*Задача 1*/
  18. int a = 4;
  19. int b = 6;
  20. int c = 2;
  21. int x = (a + b + c) / 3;
  22. System.out.println(x);
  23.  
  24. }
  25.  
  26. public static void sumSalary(int sal){
  27. /*Задача 2*/
  28. int salary = 1240;
  29. System.out.println(salary * 12);
  30.  
  31. }
  32.  
  33. public static void sumLoan(){
  34. /*Задача 3*/
  35. int firstLoan= 15000;
  36. int secondLoan= 34000;
  37. int firstLoanPeriod = 24;
  38. int secondLoanPeriod = 36;
  39. int interest = 7;
  40. float fullPayment1 = firstLoan * interest / 100+firstLoan;
  41. float fullPayment2 = secondLoan * interest / 100+secondLoan;
  42. System.out.println("Monthly payment of the first loan:" + firstLoan / firstLoanPeriod);
  43. System.out.println("Monthly payment of the second loan:" + secondLoan / secondLoanPeriod);
  44.  
  45. System.out.println("Full payment of the first loan:" + fullPayment1);
  46. System.out.println("Full payment of the second loan:" + fullPayment2);
  47.  
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement