I am trying to use a while loop and sentinel to take multiple inputs from a user. While the inputted integer doesn't equal -1 and = 3, I want it to add 1 to the variable noChange. If the variable doesn't equal -1 and = 4 or 5 I want to add 1 to another variable. and if it is not equal to -1 and is less than 3, I want to add 1 to another variable. I then need to output the amount of times each number was entered. However, I can't get past the first variable bc it just keeps adding 1 an infinite amount of times. Below is the screenshot of what I have so far.
dimanche 24 février 2019
Trouble with while loop/sentinel
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire