Advertisement
grodek118

Bank Charges

Sep 29th, 2022
745
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.21 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.  
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         double baseFee = 10;
  10.         double checkFee;
  11.         int checks;
  12.         double monthFee;
  13.  
  14.         System.out.println("How many checks did you do this month?");
  15.         checks = scanner.nextInt();
  16.  
  17.         if (checks >= 60)
  18.         {
  19.             checkFee = 0.04 * checks;
  20.             monthFee = baseFee + checkFee;
  21.             System.out.println("Bank's service fees for this month: $" + monthFee);
  22.         }
  23.         else if (checks >= 40)
  24.         {
  25.             checkFee = 0.06 * checks;
  26.             monthFee = baseFee + checkFee;
  27.             System.out.println("Bank's service fees for this month: $" + monthFee);
  28.         }
  29.         else if (checks >= 20)
  30.         {
  31.             checkFee = 0.08 * checks;
  32.             monthFee = baseFee + checkFee;
  33.             System.out.println("Bank's service fees for this month: $" + monthFee);
  34.         }
  35.         else
  36.         {
  37.             checkFee = 0.10 * checks;
  38.             monthFee = baseFee + checkFee;
  39.             System.out.println("Bank's service fees for this month: $" + monthFee);
  40.         }
  41.     }
  42. }
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement