Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

1. Library Fines

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. 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:

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 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.

HINT - no loops can be used in this problem.

Also remember we do not know how to compare strings.

a) Rewrite this problem statement in your own words. Create a list of short bulleted phrases showing all details about this problem. This list should include both the explicitly defined and implied details in the problem statement. Consider what information the program needs to remember in order to meet the requirements of the problem statement. Consider what tasks need to be completed by the program in order to meet the requirements of the problem statement. (Hint - do you think this rewritten problem statement will be longer or shorter than the original problem statement?)

Print out this rewritten problem statement to turn in with this homework.

b) 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.

· You have an overdue book titled Introduction to Java. This book is 5 days overdue.
· Mickey Mouse is 75 years old and has an overdue magazine titled Travel to Disney World. The magazine is 1 day overdue.
· Minnie Mouse is 30 years old and has an overdue magazine titled O Magazine. The magazine is 10 days overdue.
· Charlie Brown is 10 years old and has an overdue DVD titled Charlie Brown Christmas. The DVD is 2 days overdue.
· Goofy Dog is 50 years old and has an overdue DVD titled 101 Dalmations. The DVD is 2 days overdue.
· Snoopy Dog is 20 years old and has an overdue book titled Doghouse Repair. The book is 60 days overdue.

c) Print out a copy of your source code and your output text file to turn in with this homework.

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M91353041
  • Price:- $40

Guranteed 36 Hours Delivery, In Price:- $40

Have any Question?


Related Questions in Programming Language

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Question 1 what is hadoop explaining hadoop 2 what is

Question: 1. What is Hadoop (Explaining Hadoop) ? 2. What is HDFS? 3. What is YARN (Yet Another Resource Negotiator)? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow t ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

Question 1 what is a computer program what is structured

Question: 1. What is a Computer program? What is structured programming? 2. What is modular programming? Why we use it? 3. Please evaluate Sin (x) by infinite series. Then write an algorithm to implement it with up to th ...

Background informationthis assignment tests your

Background Information This assignment tests your understanding of and ability to apply the programming concepts we have covered throughout the unit. The concepts covered in the second half of the unit build upon the fun ...

Task arrays and structsoverviewin this task you will

Task: Arrays and Structs Overview In this task you will continue to work on the knight database to help Camelot keep track of all of their knights. We can now add a kingdom struct to help work with and manage all of the ...

Assignment task -q1 a the fibonacci numbers are the numbers

Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As