Created
October 3, 2017 20:17
-
-
Save viveknarang/5d3dc8ae39be3e033d1b053648d2d42b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StudentScores { | |
public static void main (String [] args) { | |
final int SCORES_SIZE = 4; | |
int[] oldScores = new int[SCORES_SIZE]; | |
int[] newScores = new int[SCORES_SIZE]; | |
int i = 0; | |
oldScores[0] = 10; | |
oldScores[1] = 20; | |
oldScores[2] = 30; | |
oldScores[3] = 40; | |
for (i = 0; i < SCORES_SIZE; i++) { | |
newScores[i] = oldScores[(i+1)%SCORES_SIZE]; | |
} | |
for (i = 0; i < SCORES_SIZE; ++i) { | |
System.out.print(newScores[i] + " "); | |
} | |
System.out.println(); | |
return; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment