Since the variable c is a String that won't work.
Already covered and solved.
Declared on the first line of the main method.
The problems continue.
6. Where do you store the values...
Type: Posts; User: Junky
Since the variable c is a String that won't work.
Already covered and solved.
Declared on the first line of the main method.
The problems continue.
6. Where do you store the values...
Each to his/her own. If I see problems in the code then I will alert the person to all of them rather wasting my time doing all this back and forth dealing with one issue at a time.
So your plan is to have OP fix one problem at a time and then when they encounter the next to come back here and post their code, ask some vague question (as most do) and then fix that one. Rinse and...
Just realised there is a 4th problem
4. The average is never calculated and displayed.
Even more
5. Wrong return type for the average method.
No there are 3 issues and they are all very real.
1. The correct condition in the if statement
2. The correct condition in the loop
3. How to exit when user enters "n"
I'm still not 100% awake yet but shouldn't the condition be while(flag > 0). If the user enters "y" to continue and you increment flag by 1 (assuming this gets fixed) then flag will be greater than...