File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confused on how to set-up my getter and setter methods.

 
Mack Grill
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

My instructions state:

"Create setProjectScore() and setQuizScore() methods for the arrays. These should only take a double as a parameter and an int as a project or quiz number. These methods should return a boolean to indicate success or failure, depending on if the project or quiz number is out of the bounds of the array. The setProjectScore() and setQuizScore() methods will place the double value into the project or quiz number index of its respective array."

I believe I have the parameter written out correctly but I am not sure how if 'int' should be inside the parameter or inside the body of the method.

This is all that I have:



 
Junilu Lacar
Bartender
Pie
Posts: 6529
21
Java Linux Mac Scala Spring
 
Greg Brannon
Bartender
Posts: 563
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take it a step at a time:
These (methods) should only take a double as a parameter and an int as a project or quiz number.

Is that what the method you've posted does?
These methods should return a boolean to indicate success or failure, depending on if the project or quiz number is out of the bounds of the array.

What does the method you posted return? Is what you posted a valid method signature?
The setProjectScore() and setQuizScore() methods will place the double value into the project or quiz number index of its respective array.

Does the method you posted do as described?
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic