Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

I am having some trouble  RSS feed

 
Junaid Mahmud
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having some trouble with this program.  It is suppose to print out the fine of an item from the library depending on the days it is overdue. Books cost 50 cents a day, magazines are 25 cents and dvds are 1.50. If you are over the age of 70 there is no fine and if you are between the ages of 6 and 17 the max fine is 1.00. Anyone else can have a max fine of 5.00. This is what I have so far.
 
timothy adigun
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Junaid Mahmud wrote:I am having some trouble with this program.  It is suppose to print out the fine of an item from the library depending on the days it is overdue. Books cost 50 cents a day, magazines are 25 cents and dvds are 1.50. If you are over the age of 70 there is no fine and if you are between the ages of 6 and 17 the max fine is 1.00. Anyone else can have a max fine of 5.00. This is what I have so far.
[/code]


Where exactly are you having problems in your code? When you compiled and ran the program what are you getting? Yes, you have told us what you wanted, but what error are you getting?
Moreover, did you notice that your code is not completely showing up? Please fix accordingly.
 
Junaid Mahmud
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is supposed to print out the following information.

THIS IS JUST AN EXAMPLE.

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)


 
Junaid Mahmud
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need help printing out the fine and the fine adjustment reason.
 
Knute Snortum
Sheriff
Posts: 4073
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is it about the fine and reason printing that you need help with?  Please TellTheDetails (that's a link).

I did see this piece of code that probably doesn't do what you want it to do:

Think about what the if statement is doing.  What will it do if age is 5?  10? 20?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!