lundi 14 janvier 2019

What can i do to solve an odd "else without if error " that works for 13/15 blocks of code

I know it s been asked many times but i have been trough all of the questions and i can't find the answer. The error is a very odd one because i have 15 "c"s and 13 of them are working, from 1-10, 11 and 12 give "else without if error" and 13,14,15 are working...i ve been trough it x100 times, i asked many people to look..i just cant find why only 11 and 12 are getting the error. I ve tried

  • sync,
  • clean
  • restart
  • rebuild
  • changing the error from being fatal to warning.

    Nothing works. Why only 11 and 12 are faulty? Te rest of them work perfectly fine ...

also i get the error if statement replaceable with switch but i don't want to change it

appart from code i will attach some prints where c11 and c12 can be found, maybe it's from something else

[The main error][1]
[I don t have an error here is just a place where c11 /c12 can be found ] 
[2]
[c.s defined,no error][3]
[also no error, just for perspective][4]

` if (get.equals("c1")) {

        if (c1 == 0) {
            for (i = 1; i < 90; i++) {
                list.add(i);
            }
            Collections.shuffle(list);
            c1 = 1;
        }
        Ques = analizatori.readQuestion(list.get(j));
        Opta = analizatori.readOptionA(list.get(j));
        Optb = analizatori.readOptionB(list.get(j));
        Optc = analizatori.readOptionC(list.get(j));
        Optd = analizatori.readOptionD(list.get(j));
        global = analizatori.readAnswer(list.get(j++));
    } else if(get.equals("c2")){
        if (c2 == 0) {
            for (i = 1; i < 25; i++) {
                list.add(i);
            }
            Collections.shuffle(list);
            c2 = 1;
        }
        Ques = celula.readQuestion(list.get(j));
        Opta = celula.readOptionA(list.get(j));
        Optb = celula.readOptionB(list.get(j));
        Optc = celula.readOptionC(list.get(j));
        Optd = celula.readOptionD(list.get(j));
        global = celula.readAnswer(list.get(j++));

    } else if (get.equals("c3")) {
        if (c3 == 0) {
            for (i = 1; i < 25; i++) {
                list.add(i);
            }
            Collections.shuffle(list);
            c3 = 1;
        }
        Ques = circulator.readQuestion(list.get(j));
        Opta = circulator.readOptionA(list.get(j));
        Optb = circulator.readOptionB(list.get(j));
        Optc = circulator.readOptionC(list.get(j));
        Optd = circulator.readOptionD(list.get(j));
        global = circulator.readAnswer(list.get(j++));
    } else if (get.equals("c4")) {
        if (c4 == 0) {
            for (i = 1; i < 25; i++) {
                list.add(i);
            }
            Collections.shuffle(list);
            c4 = 1;
        }
        Ques = digestiv.readQuestion(list.get(j));
        Opta = digestiv.readOptionA(list.get(j));
        Optb = digestiv.readOptionB(list.get(j));
        Optc = digestiv.readOptionC(list.get(j));
        Optd = digestiv.readOptionD(list.get(j));
        global = digestiv.readAnswer(list.get(j++));
    } else if (get.equals("c5")) {
        if (c5 == 0) {
            for (i = 1; i < 30; i++) {
                list.add(i);
            }
            Collections.shuffle(list);
            c5 = 1;
        }
        Ques = excretor.readQuestion(list.get(j));
        Opta = excretor.readOptionA(list.get(j));
        Optb = excretor.readOptionB(list.get(j));
        Optc = excretor.readOptionC(list.get(j));
        Optd = excretor.readOptionD(list.get(j));
        global = excretor.readAnswer(list.get(j++));
    } else if (get.equals("c6")) {
        if (c6 == 0) {
            for (i = 1; i < 27; i++) {
                list.add(i);
            }
            Collections.shuffle(list);
            c6 = 1;
        }
        Ques = glande_endocrine.readQuestion(list.get(j));
        Opta = glande_endocrine.readOptionA(list.get(j));
        Optb = glande_endocrine.readOptionB(list.get(j));
        Optc = glande_endocrine.readOptionC(list.get(j));
        Optd = glande_endocrine.readOptionD(list.get(j));
        global = glande_endocrine.readAnswer(list.get(j++));

    } else if (get.equals("c7")) {
        if (c7 == 0) {
            for (i = 1; i < 21; i++) {
                list.add(i);
            }
            Collections.shuffle(list);
            c7 = 1;
        }
        Ques = homeostazie.readQuestion(list.get(j));
        Opta = homeostazie.readOptionA(list.get(j));
        Optb = homeostazie.readOptionB(list.get(j));
        Optc = homeostazie.readOptionC(list.get(j));
        Optd = homeostazie.readOptionD(list.get(j));
        global = homeostazie.readAnswer(list.get(j++));
    } else if (get.equals("c8")) {
        if (c8 == 0) {
            for (i = 1; i < 26; i++) {
                list.add(i);
            }
            Collections.shuffle(list);
            c8 = 1;
        }
        Ques = metabolism.readQuestion(list.get(j));
        Opta = metabolism.readOptionA(list.get(j));
        Optb = metabolism.readOptionB(list.get(j));
        Optc = metabolism.readOptionC(list.get(j));
        Optd = metabolism.readOptionD(list.get(j));
        global = metabolism.readAnswer(list.get(j++));
    } else if (get.equals("c9")) {
        if (c9 == 0) {
            for (i = 1; i < 90; i++) {
                list.add(i);
            }
            Collections.shuffle(list);
            c9 = 1;
        }
        Ques = reproducator.readQuestion(list.get(j));
        Opta = reproducator.readOptionA(list.get(j));
        Optb = reproducator.readOptionB(list.get(j));
        Optc = reproducator.readOptionC(list.get(j));
        Optd = reproducator.readOptionD(list.get(j));
        global = reproducator.readAnswer(list.get(j++));
    }

    else if (get.equals("c10")) ;
    {
        if (c10 == 0) {
            for (i = 1; i < 40; i++) {
                list.add(i);
            }
            Collections.shuffle(list);
            c10 = 1;
        }
        Ques = respirator.readQuestion(list.get(j));
        Opta = respirator.readOptionA(list.get(j));
        Optb = respirator.readOptionB(list.get(j));
        Optc = respirator.readOptionC(list.get(j));
        Optd = respirator.readOptionD(list.get(j));
        global = respirator.readAnswer(list.get(j++));

    }

    else if (get.equals("c11")) //THIS IS NOT WORKING
    {
        if (c11 == 0) {
            for (i = 1; i < 21; i++) {
                list.add(i);
            }
            Collections.shuffle(list);
            c11 = 1;
        }
        Ques = sistem_muscular.readQuestion(list.get(j));
        Opta = sistem_muscular.readOptionA(list.get(j));
        Optb = sistem_muscular.readOptionB(list.get(j));
        Optc = sistem_muscular.readOptionC(list.get(j));
        Optd = sistem_muscular.readOptionD(list.get(j));
        global = sistem_muscular.readAnswer(list.get(j++));

    else if (get.equals("c12")) //AND ALSO THIS IS NOT WORKING
    {
        if (c12 == 0) {
            for (i = 1; i < 90; i++) {
                list.add(i);
            }
            Collections.shuffle(list);
            c12 = 1;
        }
        Ques = sistem_nervos.readQuestion(list.get(j));
        Opta = sistem_nervos.readOptionA(list.get(j));
        Optb = sistem_nervos.readOptionB(list.get(j));
        Optc = sistem_nervos.readOptionC(list.get(j));
        Optd = sistem_nervos.readOptionD(list.get(j));
        global = sistem_nervos.readAnswer(list.get(j++));
    }
    else if (get.equals("c13"))
    {
        if (c13 == 0) {
            for (i = 1; i < 25; i++) {
                list.add(i);
            }
            Collections.shuffle(list);
            c13 = 1;
        }
        Ques = sistem_osos.readQuestion(list.get(j));
        Opta = sistem_osos.readOptionA(list.get(j));
        Optb = sistem_osos.readOptionB(list.get(j));
        Optc = sistem_osos.readOptionC(list.get(j));
        Optd = sistem_osos.readOptionD(list.get(j));
        global = sistem_osos.readAnswer(list.get(j++));
    } else if (get.equals("c14"))
    {
        if (c14 == 0) {
            for (i = 1; i < 30; i++) {
                list.add(i);
            }
            Collections.shuffle(list);
            c14 = 1;
        }
        Ques = tesuturi.readQuestion(list.get(j));
        Opta = tesuturi.readOptionA(list.get(j));
        Optb = tesuturi.readOptionB(list.get(j));
        Optc = tesuturi.readOptionC(list.get(j));
        Optd = tesuturi.readOptionD(list.get(j));
        global = tesuturi.readAnswer(list.get(j++));
    } else if (get.equals("c15"))
    {
        if (c15 == 0) {
            for (i = 1; i < 40; i++) {
                list.add(i);
            }
            Collections.shuffle(list);
            c15 = 1;
        }
        Ques = topografia.readQuestion(list.get(j));
        Opta = topografia.readOptionA(list.get(j));
        Optb = topografia.readOptionB(list.get(j));
        Optc = topografia.readOptionC(list.get(j));
        Optd = topografia.readOptionD(list.get(j));
        global = topografia.readAnswer(list.get(j++)) '

 [1]: https://i.stack.imgur.com/bYVRp.png
 [2]: https://i.stack.imgur.com/BlsN6.png
 [3]: https://i.stack.imgur.com/snFCa.png
 [4]: https://i.stack.imgur.com/p31rw.png

Aucun commentaire:

Enregistrer un commentaire