Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

JAVA A bank charges a base service fee of $10.00 per month plus the following ch

ID: 3848818 • Letter: J

Question

JAVA

A bank charges a base service fee of $10.00 per month plus the following check fees for a commercial checking account:

$0.10 each for less than 20 checks

$0.08 each for 20-39 checks

$0.06 each for 40-59 checks

$0.04 each for 60 or more checks

Write a program that asks the user to enter the number of checks used for the month and calculates the service fees to be charged to the account. Make sure the user enters a positive value for the number of checks.

You will need:

1.) Scanner and NumberFormat objects (for input and currency formatting)

2.) A variable to store the number of checks

-Tip: Create constants for the base service fee as well as the check fees

3.) A while loop for input validation

4.) if …else if statements for outlining the choices

-Tip: Use the logical AND to represent the range of checks

5.) Comments where necessary

Samples of the output are shown below:

Output 1:

Enter the number of checks written this month: -9

Your entry is invalid. Please enter a value of 0 or greater: 9

The total fees this month for 9 checks is $10.90

Output 2:

Enter the number of checks written this month: 29

The total fees this month for 29 checks is $12.32

Explanation / Answer

// Below is the example Java class import java.util.*; import java.util.Map.Entry; public class MyTest { public static void main(String args[]) { int checks; Scanner in = new Scanner(System.in); System.out.print("Enter the number of checks written this month:"); checks = in.nextInt(); while(checks