Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

Identify the steps to follow in preparing an oral presentation.

Answered: 1 week ago

Question

The company openly shares plans and information with employees.

Answered: 1 week ago

Question

Write down the circumstances in which you led.

Answered: 1 week ago