(Votre réponse en Français, c'est juste que je l'ai également posté sur le forum de mon université)
Hey guys,
Yesterday, I was in my class of " Language & Communication" and we had to give a presentation. We were 5 groups and my teacher ask us which group wants to start but nobody answers. I told him I was going to make a random program to do it. After a few minutes I had finished making it and it was working (I've attached it to this thread).
As you can see, I've defined how many groups there are (5 - by creating a variable for each) and I've made a condition for each group (Please see my attached file if you haven't already), the condition is that the number of the group has to be different than the previous numbers.
Then, I tried to re-write my program in order to allow the user to enter the number of groups there are and to get the order of passage.
For example:
--------------------------------------------
How many groups are there? 8
Here is the order of passage:
- Group 3
- Group 1
- Group 7
- Group 6
- Group 2
- Group 8
- Group 5
- Group 4
----------------------------------------------
Here we have a problem. I reckon that to make a program like this, we should always have the same number of variable as the number of groups. Because for each variable, the condition is more or less different than the others. Or, I don't know if there is a way to do it, but it would be usefull if there exists in the java code temporary variables that the program creates itself.
Do you have any suggestion?
Cheers,
Nick
-----