we are learning java at school and we have to make an applet.
background info:
it is appearently so that a person can be devided into four learning types. to find out wich type you are is possible by answering some questions.
i have to itterate trough 80 odd questions where a user has to answer each one. after answering a question the score of one of the four learing styles has to be incremented.
the problem:
i know how to itterate with a switch statement but if i do it the way i know how it will be a lot of work and not very update-able. also i have made 80 string variables in wich i have put the 80 questions this also does not seem very efficient!
example: (sorry i am duch so my english is not all that i could be ;) )
switch(intvraag nr)
{
case 0: intvraagnr ++;
intactivist ++;
strvraag = "Ik neem vaak redelijke risico's als ik het gevoel heb dat het rechtvaardig is";
break;
case 1: intvraagnr ++;
intactivist ++;
strvraag = ("Ik ben van mening dat formele procedures en voorschriften het gedrag van mensen dwangmatig maakt");
break;
case 2: intvraagnr ++;
inttheoreticus ++;
strvraag = ("Ik tracht problemen stap voor stap op te lossen en vermijd daarbij iedere vlucht in de fantasie ");
break;
}
i would have to do this for al 80 questions for BOTH the true and false button!!!
MY QUESTION:
can somebody maybe help me out with a better way to itterate trough 80 questions and be able to apply a score at the end of it?
any helpfull reply would be greatly appreciated
tha don
background info:
it is appearently so that a person can be devided into four learning types. to find out wich type you are is possible by answering some questions.
i have to itterate trough 80 odd questions where a user has to answer each one. after answering a question the score of one of the four learing styles has to be incremented.
the problem:
i know how to itterate with a switch statement but if i do it the way i know how it will be a lot of work and not very update-able. also i have made 80 string variables in wich i have put the 80 questions this also does not seem very efficient!
example: (sorry i am duch so my english is not all that i could be ;) )
switch(intvraag nr)
{
case 0: intvraagnr ++;
intactivist ++;
strvraag = "Ik neem vaak redelijke risico's als ik het gevoel heb dat het rechtvaardig is";
break;
case 1: intvraagnr ++;
intactivist ++;
strvraag = ("Ik ben van mening dat formele procedures en voorschriften het gedrag van mensen dwangmatig maakt");
break;
case 2: intvraagnr ++;
inttheoreticus ++;
strvraag = ("Ik tracht problemen stap voor stap op te lossen en vermijd daarbij iedere vlucht in de fantasie ");
break;
}
i would have to do this for al 80 questions for BOTH the true and false button!!!
MY QUESTION:
can somebody maybe help me out with a better way to itterate trough 80 questions and be able to apply a score at the end of it?
any helpfull reply would be greatly appreciated
tha don
Comment