Im trying to write a code that has a for loop which iterates through 3 instance variables, the 3 instance variables are each set using a confirm dialogue box so if the user clicks yes they ae set with the value true and if the user clicks no they are set wit the value false. I have done this and it works fine,
however the next step is to display an alert message if less than 2 of the dialogue boxes evaluate to true. I am extremely stuck on this and ive been working on it for hours now. im thinking I will use an if statement but I dont know how to evaluate the 3 instance variables. I know how to work with one but im not even sure if its possible to evaluate 3 and have the condition evaluate to true if less tan 2 of theinstance variables evaluate to true?
I hope someone can help as im really stuck on this now.
just to clarify, what im trying to do is write a loop following these guidelines:
if less than 2 of the dialogue boxes result in true
or it may be possible to do it like this??:
if less than 2 of the instance variables are equal to true
this doesent have to be a loop if there is another way to do it, i just think a loop is the way I need to do it, however as i am a noob to programming I could ofcourse be wrong!
sorry for not adding code but I am currently moving house so have no internet connection for my pc. I am posting these messages via a mobile phone.
Thanks in advance to anyone who attempts to help me