SHARE
TWEET

Untitled

a guest Oct 21st, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package practical2part2;
  2. import java.util.Scanner;
  3. public class Mortage {
  4.     public static void main(String[] args) {
  5.         Scanner input = new Scanner(System.in);
  6.         System.out.println("Enter first salary: ");
  7.         double firstSalary = input.nextDouble();
  8.         System.out.println("Enter second salary: ");
  9.         double secondSalary = input.nextDouble();
  10.         System.out.println("Bigger salary is " + Mortage.whichSalaryIsBigger(firstSalary, secondSalary) + " and smaller is " + Mortage.whichSalaryIsSmaller(firstSalary, secondSalary));
  11.        
  12.        
  13.     }
  14.     public static double whichSalaryIsBigger(double s1, double s2) {
  15.         if (s1 > s2)
  16.             return s1;
  17.         else
  18.             return s2;
  19.        
  20.     }
  21.         public static double whichSalaryIsSmaller(double s1, double s2) {
  22.         if (s1 > s2)
  23.             return s2;
  24.         else
  25.             return s1;
  26.        
  27.     }
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top