Page 2 of 5 FirstFirst 1234 ... LastLast
Results 21 to 40 of 83
  1. #21
    tinman is offline Member
    Join Date
    Dec 2009
    Posts
    5
    Rep Power
    0

    Default

    Quote Originally Posted by Oli2uok View Post
    Im stuck on (ii) if you have any ideas!! lol
    what you stuck with

  2. #22
    Oli2uok is offline Member
    Join Date
    Dec 2009
    Posts
    20
    Rep Power
    0

    Default

    Quote Originally Posted by tinman View Post
    I need to make a few post to ps you, but what are you stuck with?????
    Cant seem to get the changeFace to work. tried loads of diff ways!!

  3. #23
    Oli2uok is offline Member
    Join Date
    Dec 2009
    Posts
    20
    Rep Power
    0

    Default Does this look right???

    [QUOTE=tinman;94730]what you stuck with[/QUOTE
    Really stuck on this code, have done it loads of diff ways.

    public int changeFace(int n);
    {

    if ((n >= 6) || (n <= 0))
    {
    OUDialog.alert("Argument to changeFace() message " + (n) +" is out of range");
    }
    else
    {
    return this.face(n);
    }
    }

    Oli

  4. #24
    Oli2uok is offline Member
    Join Date
    Dec 2009
    Posts
    20
    Rep Power
    0

    Default oli

    Quote Originally Posted by gcampton View Post
    if you post some specific questions others on here may be able to help.
    public int changeFace(int n);
    {

    if ((n >= 6) || (n <= 0))
    {
    OUDialog.alert("Argument to changeFace() message " + (n) +" is out of range");
    }
    else
    {
    return this.face(n);
    }
    }

    Oli

  5. #25
    kyussy is offline Member
    Join Date
    Dec 2009
    Posts
    10
    Rep Power
    0

    Default

    I sent you a PM with the approach I took.

  6. #26
    Oli2uok is offline Member
    Join Date
    Dec 2009
    Posts
    20
    Rep Power
    0

    Default Kyussy

    Quote Originally Posted by kyussy View Post
    I sent you a PM with the approach I took.
    I dont think it has come through!!

  7. #27
    Oli2uok is offline Member
    Join Date
    Dec 2009
    Posts
    20
    Rep Power
    0

    Default ..

    ..........

  8. #28
    kyussy is offline Member
    Join Date
    Dec 2009
    Posts
    10
    Rep Power
    0

    Default

    yeah it's vanished somehow :(

    never mind, I just said that I'd used nested ifs, it looks a bit messy but seems to work.
    for the next bit I used a mixture of the reset() method and the right() method from the marionette project.

    That bloody background square though....

  9. #29
    Oli2uok is offline Member
    Join Date
    Dec 2009
    Posts
    20
    Rep Power
    0

    Default try this email

    Quote Originally Posted by Oli2uok View Post
    I dont think it has come through!!
    A n d y O l i v e r @ a o l . c o m


    Cheers

  10. #30
    Oli2uok is offline Member
    Join Date
    Dec 2009
    Posts
    20
    Rep Power
    0

    Default Thanks

    Quote Originally Posted by kyussy View Post
    yeah it's vanished somehow :(

    never mind, I just said that I'd used nested ifs, it looks a bit messy but seems to work.
    for the next bit I used a mixture of the reset() method and the right() method from the marionette project.

    That bloody background square though....

    Thank you, will have a look tomoz now, getting bored and tired.

    Oli

  11. #31
    Thumper is offline Member
    Join Date
    Dec 2009
    Posts
    11
    Rep Power
    0

    Default

    OP here,

    I'm not looking for answers here to questions just to guidance of wheather I'm on the right track or not. And that first post could be totally wrong!. I don't think the unit books properly prepared us for this question instead, I understand things in the books but this question is difficult to me and with no one to help the java forums seems to be the best place to ask.

  12. #32
    kyussy is offline Member
    Join Date
    Dec 2009
    Posts
    10
    Rep Power
    0

    Default

    hi mate,

    Have you spoken with your tutor? If you're stuck on a question he can tell you which section of the books to look at.

    Have you got the change background method working yet? I can't get that square to update:confused:

    finished the rest though :)

  13. #33
    AliM is offline Member
    Join Date
    Dec 2009
    Posts
    3
    Rep Power
    0

    Default

    Quote Originally Posted by Thumper View Post
    I don't think the unit books properly prepared us for this question instead, I understand things in the books but this question is difficult to me and with no one to help the java forums seems to be the best place to ask.
    I'd totally agree with that, I can see how the java concepts work in the book and the activities, but i struggle to apply them to the question without searching for help on place like this.

    It doesn't help that I emailed my tutor asking for help last thursday and it took him 6 days to reply, so I now have 1 day left to finish the question!

    OP, for ii) I have used the same idea as kyussy and used if - else -if statements for the possible values of n. I can't get it to work yet but i'm just going to hand it in as i need to move on to the next bit now. Next TMA i'm going to do each question as I finish the relevent chapter so i don't get into this situation again!

    Kyussy, have you used update(), reset() in the background method? I'm just working on that now.

    I was thinking if I used bg.setXpos(75) it would only work the first time the code was used, so can we say bg.setXpos(bg.getXpos + 75) or have I just made that up? lol

  14. #34
    kyussy is offline Member
    Join Date
    Dec 2009
    Posts
    10
    Rep Power
    0

    Default

    call him and get an extension!

    bg.setXpos(bg.getXpos + 75)

    I used background rather than bg, it won't work for me with bg as it's not declared. I also have this. in there.

    try if n<=1 && n <=6
    if n== 1 etc
    if etc...

    else alert!
    Last edited by kyussy; 12-09-2009 at 03:53 PM. Reason: ..

  15. #35
    AliM is offline Member
    Join Date
    Dec 2009
    Posts
    3
    Rep Power
    0

    Default

    Quote Originally Posted by kyussy View Post
    I used background rather than bg, it won't work for me with bg as it's not declared. I also have this. in there.

    try if n<=1 && n <=6
    if n== 1 etc
    if etc...

    else alert!
    Thank you, i'll have another crack at that bit :)

  16. #36
    owlsno1 is offline Member
    Join Date
    Dec 2009
    Posts
    24
    Rep Power
    0

    Default

    Hi

    any advice on how to assign the arguments to the instance variables in (i)

    everytime i try to assign them just comes up with error messages

    thanks

  17. #37
    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 owlsno1 View Post
    any advice on how to assign the arguments to the instance variables in (i)
    everytime i try to assign them just comes up with error messages
    Without your code and your error messages, I'm afraid that we have little chance of being able to help you. Best of luck.

  18. #38
    owlsno1 is offline Member
    Join Date
    Dec 2009
    Posts
    24
    Rep Power
    0

    Default

    public Dice(Square bg, Circle tL, Circle tM, Circle tR, Circle mid, Circle bL, Circle bM, Circle bR)
    {

    this.background = bg;
    this.topLeftSpot = tL;
    this.topMiddleSpot = tM;
    this.topRightSpot = tR;
    this.middleSpot = mid;
    this.bottomLeftSpot = bL;
    this.bottomMiddleSpot = bM;
    this.bottomRightSpot = bR;
    this.reset();
    this.length = 70;

  19. #39
    owlsno1 is offline Member
    Join Date
    Dec 2009
    Posts
    24
    Rep Power
    0

    Default

    the code comes with no errors but then i need to execute a statement
    Square s = new Square(); which results in an error:
    Semantic error: Cannot cast Circle to Square

  20. #40
    evant is offline Member
    Join Date
    Dec 2009
    Posts
    33
    Rep Power
    0

    Default

    Looks like were all on the same, im stuck on the same as you owlsno1. I can get the code to compile, when i create a new square, its always the same size no matter what i change it too though. so not sure if its correct or not

Page 2 of 5 FirstFirst 1234 ... LastLast

Similar Threads

  1. Illegal Start of expression
    By Macca07 in forum New To Java
    Replies: 3
    Last Post: 11-23-2009, 08:43 AM
  2. Illegal start of expression
    By Basit56 in forum New To Java
    Replies: 2
    Last Post: 08-18-2009, 09:12 AM
  3. Illegal Start of an Expression
    By David55 in forum CLDC and MIDP
    Replies: 8
    Last Post: 11-02-2007, 09:11 PM
  4. Illegal start of expression
    By gabriel in forum New To Java
    Replies: 2
    Last Post: 08-01-2007, 05:09 PM
  5. Illegal Start of an Expression
    By David55 in forum CLDC and MIDP
    Replies: 0
    Last Post: 04-20-2007, 05:59 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
  •