Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

anyone here good at computer programming?

Options
  • 02-03-2016 8:06pm
    #1
    Registered Users Posts: 234 ✭✭


    i have an assignment due and im stuck cant figure it out, if you're somewhat decent at programming please reply and i can send my code across, ive been told to use an if statement in a for loop


Comments

  • Registered Users Posts: 628 ✭✭✭JaCrispy


    Reon wrote: »
    i have an assignment due and im stuck cant figure it out, if you're somewhat decent at programming please reply and i can send my code across, ive been told to use an if statement in a for loop

    Google it. For is a loop count e.g. for each number in 1-10 would run the code inside the for loop 10 times.

    Inside that for loop then you have an If statement - If drunk then fall down


  • Posts: 0 [Deleted User]


    Dude - at least make an effort. Explain what you are having a problem with, and what you've tried to fix the problem. Nobody's going to write your programming assignment for you. Also the development forum is probably a better spot for your question.


  • Registered Users Posts: 234 ✭✭Reon


    this is what i have



    String[] bucky = {"Green Dice","Yellow Dice","Red Dice"};

    String[] Yellowdice = {"Brain", "Brain", "Run", "Run", "Shotgun", "Shotgun"};

    String[] Reddice = {"Shotgun", "Shotgun", "Brain", "Run", "Run", "Shotgun"};

    String[] Greendice = {"Brain", "Brain", "Brain", "Shotgun", "Run", "Run"};







    for(int i=0; i<1; i++)
    {
    int tempo=+rand.nextInt(6);
    int temp=+rand.nextInt(3);
    System.out.println("Dice 1 rolled="+bucky[temp]);


    }
    ===========
    and what i need to do is just say it lands on green dice it should have either brain, shotgun or run but has to be a random one


  • Registered Users Posts: 234 ✭✭Reon


    Dude - at least make an effort. Explain what you are having a problem with, and what you've tried to fix the problem. Nobody's going to write your programming assignment for you. Also the development forum is probably a better spot for your question.

    i have the just of it done


  • Registered Users Posts: 1,456 ✭✭✭FSL


    Draw yourself a flow chart of what the programme is supposed to do.
    Pay particular attention to ensuring you do not leave any loose ends when you have a conditional statement i.e. a question. For example a comparison has three results equal, less than or greater than.
    Convert the flowchart to a series of written statements describing the steps.
    Read the syntax of statements in the programming language you are supposed to use.
    Pay particular attention to the suggested statements.

    You should then be well on the way to producing the code.


  • Advertisement
  • Registered Users Posts: 36,167 ✭✭✭✭ED E


    Reon wrote: »
    for(int i=0; i<1; i++)

    This line says you didnt listen in lectures, didn't attend or completely failed to comprehend the concept. If this is a degree course then you're 60 credits in and to be at that level is very very worrying.

    I suggest you start from the start of the module reading material and make sure you understand each page before continuing. There are rakes of great videos on youtube if you don't understand a concept.


  • Registered Users Posts: 760 ✭✭✭mach1982


    Like everyone else said , try Google , it's your friend when it comes to programming there some great videos out there.

    New Boston , Derek Banas ( and no I not link them)


    if that fails find you local Coder Dojo , I am some kids there might be willing to help you :p


  • Registered Users Posts: 1,468 ✭✭✭Asmooh




Advertisement