You may want to review some of the material in the "Starting Java" thread that is stickied at the top of the forum for basics.
What part of the assignment do you not understand? What do you have so far?
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
They mean make a method that has a parameter, numberOfEggs, which is an integer.
BestJewSinceJC
Posting Maven
2,772 posts since Sep 2008
Reputation Points: 874
Solved Threads: 354
it is OK the beginning always be like that
you may want to try read this, I had when I was in my earlier weeks
http://www.freejavaguide.com/corejava.htm
also the Deitel and Deitel resource are worthy to read
if you have visited that link and not helping plz let me know, and wish you can send what sites you have tried so far,
passing means that to send the parameter the method would use in its calculation, sending them when you call the method,
hope this helps, good luck
knowledgelover
Junior Poster in Training
86 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
I dont understand what it means by "passing"
'passing' here is about the same as in sports: one guy has the ball, he 'passes' it to another guy, now that other guy has controle over it.
// class that uses an object or class
Sports.showPass("this ball");
// other class -> Sports.java
public void showPass(String pass){
// the String-object 'pass' is passed on to the method
System.out.println("the first player passed " + pass);
}
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
public class Eggs2
{
public static void main(String[] args) {
int dozen = 12;
int eggs = 13;
numberOfEggs();
eggs - dozen = remaining;
}
public static void numberOfEggs;
System.out.println ("13 eggs are one full dozen + remaining")
// Kelly Bowden - Assignment # 3, Chapter 3, February 3, 2009
}
}
I'm not really sure what you're trying to do in here, but there are indeed a number of serious errors in here.
public class Eggs2
{
public static void main(String[] args) {
int dozen = 12;
int eggs = 13;
// numberOfEggs();
// eggs - dozen = remaining;
int remaining = eggs - dozen;
numberOfEggs(remaining);
}
//public static void numberOfEggs;
public static void numberOfEggs(int remaining){
//System.out.println ("13 eggs are one full dozen + remaining")
System.out.println("13 eggs are one full dozen + remaining");
// what I think you want to do here is:
System.out.println("13 eggs are one full dozen + " + remaining);
// Kelly Bowden - Assignment # 3, Chapter 3, February 3, 2009
}
}
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
Look at a piece of example code. . you're attempting to use numberOfEggs as if its a method, but you have not declared it w/ a method header & method body.
BestJewSinceJC
Posting Maven
2,772 posts since Sep 2008
Reputation Points: 874
Solved Threads: 354
and what's your point?
you don't show what code it is you 're looking into, you don't say what problems you 're encountering, you're not even taking the time to create a new thread for your questions (if any) ..
not really the most valuable post on this forum
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433