943,667 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1279
  • Java RSS
You are currently viewing page 1 of this multi-page discussion thread
Feb 2nd, 2009
0

I am so confused!

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
girlinwayside is offline Offline
8 posts
since Dec 2007
Feb 2nd, 2009
0

Re: I am so confused!

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?
Last edited by Ezzaral; Feb 2nd, 2009 at 5:16 pm.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 838
Posting Genius
Ezzaral is offline Offline
6,756 posts
since May 2007
Feb 2nd, 2009
0

Re: I am so confused!

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
girlinwayside is offline Offline
8 posts
since Dec 2007
Feb 2nd, 2009
0

Re: I am so confused!

Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 838
Posting Genius
Ezzaral is offline Offline
6,756 posts
since May 2007
Feb 2nd, 2009
0

Re: I am so confused!

They mean make a method that has a parameter, numberOfEggs, which is an integer.
Reputation Points: 874
Solved Threads: 352
Posting Maven
BestJewSinceJC is offline Offline
2,758 posts
since Sep 2008
Feb 3rd, 2009
0

Re: I am so confused!

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; }
}
Reputation Points: 8
Solved Threads: 1
Newbie Poster
doleh is offline Offline
9 posts
since Jul 2008
Feb 3rd, 2009
0

Re: I am so confused!

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
Last edited by knowledgelover; Feb 3rd, 2009 at 6:51 am. Reason: link update
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
knowledgelover is offline Offline
86 posts
since Nov 2007
Feb 3rd, 2009
0

Re: I am so confused!

Thanks everyone. I will look over the link and see if it helps.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
girlinwayside is offline Offline
8 posts
since Dec 2007
Feb 4th, 2009
0

Re: I am so confused!

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.

Java Syntax (Toggle Plain Text)
  1. // class that uses an object or class
  2. Sports.showPass("this ball");
  3.  
  4. // other class -> Sports.java
  5. public void showPass(String pass){
  6. // the String-object 'pass' is passed on to the method
  7. System.out.println("the first player passed " + pass);
  8. }
Reputation Points: 919
Solved Threads: 354
Nearly a Posting Maven
stultuske is online now Online
2,487 posts
since Jan 2007
Feb 4th, 2009
0

Re: I am so confused!

Click to Expand / Collapse  Quote originally posted by stultuske ...
'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.

Java Syntax (Toggle Plain Text)
  1. // class that uses an object or class
  2. Sports.showPass("this ball");
  3.  
  4. // other class -> Sports.java
  5. public void showPass(String pass){
  6. // the String-object 'pass' is passed on to the method
  7. System.out.println("the first player passed " + pass);
  8. }

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
girlinwayside is offline Offline
8 posts
since Dec 2007

This thread is more than three months old

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.
Message:
Previous Thread in Java Forum Timeline: acces sqlserver express remotely using java
Next Thread in Java Forum Timeline: Binary tree





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC