Click here to Skip to main content
15,911,530 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Am trying to develop an event management system which will allocate students automatically to a house .

I have the following data with me

House Number

Students Number


Can anyone suggest an Idea ??????

The idea should be .

if the house number is 4 (A,B,C,D)and students number is 100 i need to allocate students as the following

A B C D

1 2 3 4

5 6 7 8
. . . .
. . . .


please suggest an algorithm ...I am in a desperate situation...thats is why..
Posted
Updated 20-Dec-10 22:31pm
v2

1 solution

<br />
int currentStudent = 0;<br />
int currentHouse = 0;<br />
<br />
for(int i = 0;i<100;i++){<br />
 MoveStudent(currentHouse,currentStudent);<br />
 currentStudent += 1;<br />
 currentHouse += 1;<br />
 if (currentHouse >= 4){<br />
  currentHouse = 0;<br />
 }<br />
}<br />

this isn't rocket science.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900