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: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:00
Which demographic challenge is europe currently experiencing? a. an aging and decreasing population b. a baby boomc. an unequal distribution between males and females d. a large group of teenagers moving through the school system(i chose a but i'm unsure)
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
To move a file or folder in microsoft windows, you can click and hold down the left mouse button while moving your mouse pointer to the location you want the file or folder to be, which is also known as.
Answers: 3
question
Computers and Technology, 24.06.2019 00:00
For the following example of making a peanut butter and jelly sandwich, identify which are inputs, processes, or outputs: bread scooping and spreading peanut butter plate scooping and spreading jelly finished sandwich putting two pieces of covered bread together dirty plate crumbs
Answers: 2
question
Computers and Technology, 24.06.2019 09:50
Create a string list. 2. use console.readline() to collect values of firstname, lastname, street, city, state, zip, save them to list. 3. write a simple linq statement, call method uppercasewords() to change first letter to uppercase. 4. create a foreach statment to display the information. public static string uppercasewords(string value) { char[] array = value.tochararray(); if (array.length > = 1) { if (char.islower(array[0])) { array[0] = char.toupper(array[0]); } } for (int i = 1; i < array.length; i++) { if (array[i - 1] == ' ') { if (char.islower(array[i])) { array[i] = char.toupper(array[i]); } } } return new string(array);
Answers: 3
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.04.2021 06:50
question
Mathematics, 07.04.2021 06:50
question
Social Studies, 07.04.2021 06:50
question
Computers and Technology, 07.04.2021 06:50
Questions on the website: 13722363