Question
Using Java. for beginners: if else statments do not use objects for this assignment. A local public library needs a program to calculate the overdue
Using Java. for beginners: if else statments
do not use objects for this assignment.
A local public library needs a program to calculate the overdue fines owed by its patrons. The library needs the clerk to enter the patrons library card number, age of the patron, the number of days overdue for the item and the type of the item using the follow (enter 1, 2 or 3):
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. There is a maximum fine assessed of $5.00. Senior Citizens (over the age of 70) do not pay fines. Juvenile patrons (ages 6 through 17) pay a maximum fine of $1.00.
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:
Card number 12345
Age 22
Item Type DVD
Number of Days Overdue 2
Overdue Fine $3.00
Fine adjustment reason (e.g, Senior citizen, Juvenile, exceed max)
Each time the program is executed it calculates the fine for a single item. If the user enters invalid data, then a message must be presented on the screen specifying the invalid information and the calculation is aborted.
Run your program multiple times using the following information as input. After each run of the program save your entire console output screen to a text file as discussed in our labs.
11111 is 75 years old and has an overdue magazine. The magazine is 1 day overdue.
22222 is 30 years old and has an overdue magazine. The magazine is 10 days overdue.
33333 is 10 years old and has an overdue DVD. The DVD is 2 days overdue.
44444 is 50 years old and has an overdue DVD. The DVD is 2 days overdue.
55555 is 20 years old and has an overdue book. The book is 60 days overdue.
66666 is 15 years old and has an overdue magazine. The magazine is 3 days overdue.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started