Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- public class Main {
- public static void main(String[] args) {
- /*Задача 1*/
- sumAverage(4, 6, 2);
- /*Задача 2*/
- sumSalary(1240);
- /*Задача 3*/
- sumLoan();
- }
- public static void sumAverage(int number1,int number2, int number3){
- /*Задача 1*/
- int a = 4;
- int b = 6;
- int c = 2;
- int x = (a + b + c) / 3;
- System.out.println(x);
- }
- public static void sumSalary(int sal){
- /*Задача 2*/
- int salary = 1240;
- System.out.println(salary * 12);
- }
- public static void sumLoan(){
- /*Задача 3*/
- int firstLoan= 15000;
- int secondLoan= 34000;
- int firstLoanPeriod = 24;
- int secondLoanPeriod = 36;
- int interest = 7;
- float fullPayment1 = firstLoan * interest / 100+firstLoan;
- float fullPayment2 = secondLoan * interest / 100+secondLoan;
- System.out.println("Monthly payment of the first loan:" + firstLoan / firstLoanPeriod);
- System.out.println("Monthly payment of the second loan:" + secondLoan / secondLoanPeriod);
- System.out.println("Full payment of the first loan:" + fullPayment1);
- System.out.println("Full payment of the second loan:" + fullPayment2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement