Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double baseFee = 10;
- double checkFee;
- int checks;
- double monthFee;
- System.out.println("How many checks did you do this month?");
- checks = scanner.nextInt();
- if (checks >= 60)
- {
- checkFee = 0.04 * checks;
- monthFee = baseFee + checkFee;
- System.out.println("Bank's service fees for this month: $" + monthFee);
- }
- else if (checks >= 40)
- {
- checkFee = 0.06 * checks;
- monthFee = baseFee + checkFee;
- System.out.println("Bank's service fees for this month: $" + monthFee);
- }
- else if (checks >= 20)
- {
- checkFee = 0.08 * checks;
- monthFee = baseFee + checkFee;
- System.out.println("Bank's service fees for this month: $" + monthFee);
- }
- else
- {
- checkFee = 0.10 * checks;
- monthFee = baseFee + checkFee;
- System.out.println("Bank's service fees for this month: $" + monthFee);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement