Results 1 to 19 of 19
  1. #1
    nono is offline Member
    Join Date
    Nov 2010
    Posts
    10
    Rep Power
    0

    Default Can anyone help me in my Assignment

    hi


    I really hate java , I have a problem with it


    what can I do to enjoy with it


    and I have Assignment that cut off date 20 nov


    I solve it but I'm not sure that is true !


    can anyone help me here or in my email :)
    Last edited by nono; 11-10-2010 at 01:50 PM.

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Lots of people can. Ask a specific question.

  3. #3
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,965
    Rep Power
    8

    Default

    ...what's your question?

    Read this: How To Ask Questions The Smart Way

  4. #4
    nono is offline Member
    Join Date
    Nov 2010
    Posts
    10
    Rep Power
    0

    Default

    there are errors in this codes :

    Dancer sam = new Dancer();

    Semantic error: Typed variable declaration : Constructor error: Can't create instance of an interface: interface Dancer


    DancerFrog alice = new Frog();
    Semantic error: Cannot cast Frog to DancerFrog

    kermit.danceSteps();
    Semantic error: Attempt to resolve method: danceSteps() on undefined variable or class name: kermit

    - helen.getReady();
    Semantic error: Attempt to resolve method: getReady() on undefined variable or class name: helen



    I want to know detailed explanation of Semantic error in these code

    :(

  5. #5
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,965
    Rep Power
    8

    Default

    What don't you understand about the errors?

    Dancer is an interface. You can't directly instantiate an interface.
    Frog is not an extension of DancerFrog. Perhaps the other way around?
    The variables kermit and helen are undefined in the score you're trying to access them.

    It seems to me like you really need to go back to the basic tutorials or the early notes you took, if this is for a class.

  6. #6
    nono is offline Member
    Join Date
    Nov 2010
    Posts
    10
    Rep Power
    0

    Default

    I am a beginner in Java and c++ and I have alots of Assignments and
    Quizzes in this period ,,



    ummm mean that this codes: helen.getReady(); + getReady(); I don’t use declarations to create variables that must provide methods to access values stored there.

    kermit.danceSteps();


    mean I must set a int value (Parameter)inside danceSteps();

    right ??




    I feel like I want to cry


    really confused

  7. #7
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,965
    Rep Power
    8

    Default

    Maybe if you broke down each of your problems into a separate SSCCE that recreated the error, we could explain what they mean. As of now, your questions are way too broad to provide any real help.
    Last edited by KevinWorkman; 11-10-2010 at 02:41 PM.

  8. #8
    nono is offline Member
    Join Date
    Nov 2010
    Posts
    10
    Rep Power
    0

    Default

    ummmm thank you bro


    I will see this link and try to solve the rest of the questions

  9. #9
    nono is offline Member
    Join Date
    Nov 2010
    Posts
    10
    Rep Power
    0

    Default

    o

    can anyone see to my Assignment in this link

    is my solution correct

    .. Is there a mistake ??

    can help me in question 1 (ii) >> - DancerFrog alice = new Frog();
    Semantic error: Cannot cast Frog to DancerFrog

    and the last question2 (d)


    please help me :(

  10. #10
    nono is offline Member
    Join Date
    Nov 2010
    Posts
    10
    Rep Power
    0

    Default

    ??


    :o


    :(

  11. #11
    nono is offline Member
    Join Date
    Nov 2010
    Posts
    10
    Rep Power
    0

    Default

    :eek:

    up :(

  12. #12
    al_Marshy_1981 is offline Senior Member
    Join Date
    Feb 2010
    Location
    Waterford, Ireland
    Posts
    748
    Rep Power
    5

    Default

    I am not clicking on some link when you can just as easily post your code here

  13. #13
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Agree. If the code is too long to post here, then it's too long for us to review. Otherwise if you post it here (with code tags), we'll all have an idea of what your problem(s) may be and how to help you.

    Best of luck!

  14. #14
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Edit: My apologies: it seems that you did show what you've done for portions of your assignment.
    Last edited by Fubarable; 11-14-2010 at 05:15 AM.

  15. #15
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by nono View Post
    I am a beginner in Java and c++ and I have alots of Assignments and
    Quizzes in this period ,,

    ummm mean that this codes: helen.getReady(); + getReady(); I donít use declarations to create variables that must provide methods to access values stored there.

    kermit.danceSteps();


    mean I must set a int value (Parameter)inside danceSteps();

    right ??
    Correct. According to the Dancer interface:
    Java Code:
    public interface Dancer
    {
      public void danceSteps(int n);
    }
    danceSteps takes an int parameter.

  16. #16
    nono is offline Member
    Join Date
    Nov 2010
    Posts
    10
    Rep Power
    0

    Default

    I'm sorry for the inconvenienceo:o



    (d) Suppose the following statement is executed:
    DancerFrog frog2 = frog1;
    How many variables are there? How many DancerFrog objects now exist? Explain your answer. [2 marks]





    my Solution :



    There are two variables : frog1 , frog2

    And one object : DancerFrog

    First we have this statement Frog frog1 = new Frog() which means we have created a new instance of the class Dancer Frog named frog1 and we set initial values: Position 1 and colour green

    Also we have a new instance of the class DancerFrog named frog2 but we did nít set initial values as frog1.

    And for this part of statement : frog2 = frog1
    assigned the address of the DanerFrog object referenced by frog1 to the variable frog2.

    So both variables, frog1 and frog2 reference the same DanerFrog object.

    This is what we mean in this statement : DancerFrog frog2 = frog1


    ::



    it will be DancerDFrog or Frog ?

  17. #17
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by nono View Post
    (d) Suppose the following statement is executed:
    DancerFrog frog2 = frog1;
    How many variables are there? How many DancerFrog objects now exist? Explain your answer. [2 marks]

    my Solution :
    There are two variables : frog1 , frog2

    And one object : DancerFrog
    Correct. There are two variables and one object which may be a DancerFrog object (I didn't see the constructor call, so the object can be a Frog object or an object of any class that derives from Frog such as DancerFrog).

    First we have this statement Frog frog1 = new Frog() which means we have created a new instance of the class Dancer Frog named frog1 and we set initial values: Position 1 and colour green
    frog1 does not reference a DancerFrog object but rather a Frog object. I don't know if its position property is one or the colour green since I have not seen the code for the Frog constructor.


    Also we have a new instance of the class DancerFrog named frog2 but we did nít set initial values as frog1.
    I didn't see you setting initial values on frog1, so this statement confuses me.

    And for this part of statement : frog2 = frog1
    assigned the address of the DanerFrog object referenced by frog1 to the variable frog2.

    So both variables, frog1 and frog2 reference the same DanerFrog object.
    correct.


    This is what we mean in this statement : DancerFrog frog2 = frog1


    it will be DancerDFrog or Frog ?
    Can you clarify this a bit?

  18. #18
    nono is offline Member
    Join Date
    Nov 2010
    Posts
    10
    Rep Power
    0

    Default

    Quote Originally Posted by Fubarable View Post
    Correct. There are two variables and one object which may be a DancerFrog object (I didn't see the constructor call, so the object can be a Frog object or an object of any class that derives from Frog such as DancerFrog).


    frog1 does not reference a DancerFrog object but rather a Frog object. I don't know if its position property is one or the colour green since I have not seen the code for the Frog constructor.

    Frog code in q1

    I didn't see you setting initial values on frog1, so this statement confuses me.


    also in q1:D


    correct.




    Can you clarify this a bit?


    this is full Question and answer:

    see the attachments
    Attached Thumbnails Attached Thumbnails Can anyone help me in my Assignment-1-.jpg   Can anyone help me in my Assignment-2-.jpg   Can anyone help me in my Assignment-3-.jpg   Can anyone help me in my Assignment-4-.jpg  

  19. #19
    nono is offline Member
    Join Date
    Nov 2010
    Posts
    10
    Rep Power
    0

Similar Threads

  1. assignment help
    By esallender in forum New To Java
    Replies: 4
    Last Post: 10-25-2010, 12:10 PM
  2. Can somebody help me in my assignment
    By coolstruxx in forum NetBeans
    Replies: 0
    Last Post: 03-24-2009, 01:27 AM
  3. I am looking for help with an assignment
    By nanoo51969 in forum New To Java
    Replies: 1
    Last Post: 03-23-2009, 09:41 PM
  4. GUI First Assignment-DUE 8/1/08
    By ljk8950 in forum AWT / Swing
    Replies: 2
    Last Post: 08-01-2008, 04:23 AM
  5. First GUI Assignment
    By ljk8950 in forum New To Java
    Replies: 1
    Last Post: 07-31-2008, 07:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •