• Post Reply Bookmark Topic Watch Topic
  • New Topic

parameter  RSS feed

 
ima zack
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..my name ima..i'm novice. this is my code and its still have errors.my friend said its because of missing parameter but i dont understand. i need your help.

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37496
547
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch! I added code tags to make the code easier to read.

This is a variable declaration:
int hours

You need to declare a variable before you use it. Take a look at totalHours. It isn't declared anywhere. It is just used. Where can you add the type to declare it?

The other one is hoursPerDay. You do declare it. But you do so in one method so you can't use it in the other. What are you trying to accomplish with the println?
 
ima zack
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tq Jeanne for your help.i'm already corrected the code but still not successful.

 
Campbell Ritchie
Marshal
Posts: 56562
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use the code button and indent your code. Suggestions about indentation here. Correct indentation may make errors obvious which you cannot see otherwise.

Please tell us what goes wrong, otherwise we cannot help.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!