Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use Java to write this program no objects and method needed. only selection statements and loops. nothing more. A local public library needs a program

use Java to write this program

no objects and method needed. only selection statements and loops. nothing more.

A local public library needs a program to calculate the overdue fines owed by its patrons. The library needs the clerk to enter the full name and age of the patron. The clerk also needs to enter the name and the number of days overdue for the item. (The library accounts for full days overdue and not partial days overdue.) The library wants the clerk to be presented with a menu from which the type of material overdue can be chosen. The menu should look as follows:

1. Book

2. Magazine

3. DVD

Books that are overdue are assessed a fine of 50 cents per day. Magazines are assessed a fine of 25 cents per day. DVDs are assessed a fine of $1.50 a day. Senior Citizens (over the age of 70) do not pay fines. Juvenile patrons (ages 6 through 17) pay a maximum fine of $1.00. There is a maximum fine assessed of $5.00 for all other patrons.

Once the fine has been calculated all information about the patron and the overdue material should be printed to the screen. Here is an example of the report that should be output:

Name Mickey Mouse

Age 22

Item Name Fantasia

Item Type DVD

Number of Days Overdue 2

Overdue Fine $3.00

Each time the program is executed it calculates the fine for a single patron.

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

Students also viewed these Databases questions