Advertisement
thotfrnk

selection2

Nov 11th, 2022 (edited)
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.04 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class NumberTwo
  3. {
  4.     public static void main(String[] args) {
  5.        
  6.         Scanner input = new Scanner (System.in);
  7.        
  8.         double loan, deposit = 0;
  9.        
  10.         System.out.println("Please enter your loan amount:$ ");
  11.         loan = input.nextDouble();
  12.        
  13.         if (loan < 25000.00) {
  14.             deposit = loan * 0.05;
  15.         }
  16.         else
  17.             if (loan == 25000.00) {
  18.                 deposit = 1250.00;
  19.             }
  20.         else
  21.             if (loan > 25000.00 && loan <= 49000.00) {
  22.                 deposit = (loan * 0.1) + 1250.00;
  23.             }
  24.         else
  25.             if (loan == 50000.00) {
  26.                 deposit = 5000.00;
  27.             }
  28.         else
  29.             if (loan > 50000.00 && loan <= 100000.00) {
  30.                 deposit = (loan * 0.25) + 5000.00;
  31.             }
  32.         else
  33.              System.out.println("No loans over $100,000.00 is allowed.");
  34.              
  35.         System.out.println("Your required deposit is:$ " +deposit);    
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement