subject

Write a loop that sets newscores to oldscores shifted once left, with element 0 copied to the end. ex: if oldscores = {10, 20, 30, 40}, then newscores = {20, 30, 40, 10}. note: these activities may test code with different test values. this activity will perform two tests, the first with a 4-element array (newscores = {10, 20, 30, 40}), the second with a 1-element array (newscores = {199}).

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;

/* your solution goes here */

for (i = 0; i < scores_size; ++i) {
system. out. print(newscores[i] + " ");
}
system. out. println();
return;
}
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 15:00
Marissa is a high school student who wants to be a hydroelectric production manager. she talks to her guidance counselor about her education path, and the counselor says that she needs to get an associate’s degree from a four-year college and will follow that with significant on-the-job training. what error did the counselor make while advising marissa? marissa will not have on-the-job training. marissa also needs a three-year apprenticeship. marissa only needs to attend a two-year college. marissa needs a bachelor’s degree.
Answers: 1
question
Computers and Technology, 22.06.2019 20:10
Assume that minutes is an int variable whose value is 0 or positive. write an expression whose value is "undercooked" or "soft-boiled" or "medium-boiled" or "hard-boiled" or "overcooked" based on the value of minutes. in particular: if the value of minutes is less than 2 the expression's value is "undercooked"; 2-4 would be a "soft-boiled", 5-7 would be "medium-boiled", 8-11 would be "hard-boiled" and 12 or more would be a "overcooked".
Answers: 1
question
Computers and Technology, 22.06.2019 22:00
During physical science class ben and jerry connected three identical lightbulbs in parallel to a battery where happens when ben removes one of the lightbulbs from it’s socket
Answers: 2
question
Computers and Technology, 23.06.2019 03:00
What are the different parts of computer
Answers: 2
You know the right answer?
Write a loop that sets newscores to oldscores shifted once left, with element 0 copied to the end. e...
Questions
question
Mathematics, 31.07.2020 22:01
question
Social Studies, 31.07.2020 22:01
question
Mathematics, 31.07.2020 22:01
Questions on the website: 13722361