In the code below I have 3 loops, all with if and else statements in them. The purpose of having these loops is to ensure the user types a valid integer in. While trying to increase redundancy, I tried putting a character in for one of my three int values. The result is the program endlessly loops.
The solution I’m looking for is this. I want to keep Assignement1, Assignment2, and Test1 all integers. I also want to keep the program from endlessly looping when you input a letter rather than a number.
the while() portion needs to have a test in it, the way that you run it now is saying that while("true") and there's no way to end the loop. Try watching this guy's tutorial on do while loops; http://www.youtube.com/watch?v=yRdPe2acogw , you may want to use plain old while loops instead.