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, 22.06.2019 11:10
Look at the far left lane in the picture. explain what the red car is doing and what it needs to do to travel safely.
Answers: 2
question
Computers and Technology, 22.06.2019 15:00
The three logical operators used to write compound conditions are "and," "or," and "not." a: true b: false
Answers: 2
question
Computers and Technology, 23.06.2019 11:30
Me dangers of social media and the internetexplain what each means: 1) social media and phones have become an addiction.2) outside people have access to you all the time.3) cyberstalking4) cyberbullying5) catphishing6) viruses7) identity theft8) credit card fraud9) hacking10) money schemes
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
What does the faves button do? a. users mark a web page as a favorite b. leads other readers to favor a specific page c. readers sort and align their favicons, or favorite icons d. leads users to a message board where they can post questions
Answers: 1
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, 07.12.2020 23:20
Questions on the website: 13722361