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, 22.06.2019 08:10
Alook-up table used to convert pixel values to output values on a monitor. essentially, all pixels with a value of 190 or above are shown as white (i.e. 255), and all values with a value of 63 or less are shown as black (i.e. 0). in between the pixels are scaled so that a pixel with a value p is converted to a pixel of value 2/127 −+3969). if a pixel has a value of 170 originally, what value will be used to display the pixel on the monitor? if a value of 110 is used to display the pixel on the monitor, what was the original value of the pixel?
Answers: 1
question
Computers and Technology, 22.06.2019 14:30
If the polar bear were taken out of the food chain what would happen to the seal population the seal population would diminish the seal population would grow dramatically the seal population would stay the same the seal population would decrease slightly
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
In a compound condition, both conditions on either side of the logical operator and must be true for the overall condition to be true. a: true b: false
Answers: 1
question
Computers and Technology, 23.06.2019 04:20
4. a1. vince owns a television repair shop that is insured undera commercial package policy. the policy includes thebuilding and personal property coverage form and thecauses-of-loss broad form. the declarations page indicatesthat coverage applies to both the building and the namedinsured's business property. explain whether or not thefollowing losses would be covered under his policy.a. a fire occurs on the premises, and the building isbadly damaged.b. a burglar steals some money and securities from anunlocked safe.c. a business computer is damaged by vandals whobreak into the shop after business hours.d. a tornado touches down near the store. several tel-evision sets of customers in the shop for repair aredamaged in the storm.til
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
Health, 07.07.2020 22:01
question
Physics, 07.07.2020 22:01
question
Health, 07.07.2020 22:01
Questions on the website: 13722360