I am taking an online java programming class this quarter and the book I have just does not do a good job of explaining anything! The more I read it, the more confused I become!
Can someone refer me to an article or site that explains creating methods in terms that are easy to understand? I'll post a copy of my assignment below so you can have an idea of what Im looking for..
Create a class named Eggs. Its main() method holds an integer vaiable named numberOfEggs to which you will assign a value. Create a method to which you pass numberOfEggs.
The method displays the eggs in dozens; for example, 50 eggs is 4 full dozen with two left over.
Save the program as Eggs.java.
I am really confused about the whole deal. This is only the second week of the class and I haven't been able to grasp the idea of any of it thus far. I dont understand what it means by "passing"
This is what I have so far.
public class Eggs
{
public static void main(String[] args)
{
int numberofEggs = 25;
System.out.println("25 eggs are two full dozen plus one");
}
}
Ill go read though that thread.. thanks
Last edited by girlinwayside; Feb 2nd, 2009 at 5:30 pm.
try to read in elliot coffman book in java its very simple to understand
public class eggs
{public static void main(String args [])
{
int NumberOfEggs =25;
System.out.print("Full dozen"+ duzen(NumberOfEggs ) );
}
public int duzen( int x)
{return x/12; }
}
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
Last edited by knowledgelover; Feb 3rd, 2009 at 6:51 am. Reason: link update
// the String-object 'pass' is passed on to the method
System.out.println("the first player passed " + pass);
}
Thanks! Those are terms I can understand.. LOL I will be working on this all day today - I have three assignments and an application test all due today! EEEKKK! I have been reading the same chapter in my textbook since Sunday trying to understand this stuff.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.