How to print print the first and last numbers from the list do while loop
Take the System.out out of the loop int w=-10; System.out.println(w); do { w++; } while (w<=2020); System.out.println(w-1);
Take the System.out out of the loop int w=-10; System.out.println(w); do { w++; } while (w<=2020); System.out.println(w-1);
Use this loop: for (int i = prevScore.length; i > 0; i–){ System.out.println(prevScore[i-1] + ” ” + prevScoreName[i-1]); } I think it should solve your problem. Update based on your updated program. Move the following code above the start of the ‘do’ loop. int [] prevScore = new int[] { 0 }; String [] prevScoreName … Read more
You can use any IDE you want… you just need good algorithms, the IDE or language used does not really make much of a difference.
System.out.println(…); Does print a string to stdout if you want to assign student.toString() to stringthing, then do : stringthing = student.toString(); And after you can do : System.out.println(stringthing);