+ 1
What do I need to do in order for this to run?
On my codes the grading average program is almost complete. It is a do-while loop since I want the loop to do its thing at least once. How do I make it properly run? I understand that the while condition needs to check for Boolean, then run once more. I understand that the mobile compiler only prompts users once, I am building this program on BlueJay. https://code.sololearn.com/cWOK0ZZTd193/?ref=app
2 Réponses
+ 2
As you delete, line numbers might change, so just delete the code but keep the line.
Delete code on line 52 and 67, you don't have to create a new Scanner object every time you can just reuse input. Change stdIn and input1 to just input at line 53 and 68. Also at line 53 change input.nextLine(); to input.next();. Delete the spike brackets at line 65 and 70. After while(testNumber!=1); cut the print, input and increment code and paste it inside of the do while loop before condition check. And delete continue in the if(ch=='y'||ch=='Y') around line 57.
0
Thank you Kilowac! I took your advice and realised i needed to check my logic with do-while loops. Thank you
https://code.sololearn.com/cbDYEP17e35L/?ref=app