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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

anyone here good at computer programming?

  • 02-03-2016 7:06pm
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 635 ✭✭✭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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 Posts: 36,170 ✭✭✭✭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, Registered Users 2 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, Registered Users 2 Posts: 1,469 ✭✭✭Asmooh




Advertisement