1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
gtnhenbr [62]
3 years ago
14

Write a loop that sets newScores to oldScores shifted once left, with element 0 copied to the end. Ex: If oldScores = {10, 20, 3

0, 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}). See "How to Use zyBooks". . Also note: If the submitted code tries to access an invalid array element, such as newScores[9] for a 4-element array, the test may generate strange results. Or the test may crash and report "Program end never reached", in which case the system doesn't print the test case that caused the reported message.
Computers and Technology
1 answer:
poizon [28]3 years ago
5 0

Answer:

int[] newScores = new int[oldScores.length];

for (int i = 0; i < oldScores.length; i++) {

   if (i==oldScores.length-1){

        newScores[oldScores.length-1] = oldScores[0];

   } else {

        newScores[i] = oldScores[i+1];

   }

}

Explanation:

Code is written in Java

You might be interested in
Write a method public static ArrayList merge(ArrayList a, ArrayList b) that merges two array lists, alternating elements from bo
bogdanovich [222]
The answer would be 798 since all of them combined with the square root dividing it would give you that.
4 0
3 years ago
Select the four tactics that cyber criminals use for stealing information from the list below.
Snowcat [4.5K]
Baiting clickjacking pharming spamming
6 0
2 years ago
A farmer sells tomatoes. For some reason, the farm obeys mechanical laws of fate.
Mars2501 [29]

Answer:

Here are the if/elif statements:

if tomatoes == 24:  #if farmer sells exactly two dozen tomatoes

   watermelons +=4  #farmer receives 4 watermelons

elif tomatoes >= 12:  #else farmer sells at least a dozen tomatoes

   watermelons +=2  #farmer receives 2 watermelons

else:

   tomatoes<12   #On the days that farmer sells less than a dozen tomatoes

   apples +=1  #farmer will get a single apple

Explanation:

You can test the working of these if elif statements by this program:

tomatoes = int(input("Enter the amount of tomatoes sold: "))  #prompts user to enter number of tomatoes

watermelons = 0  #initialize watermelons value to 1

apples = 0  #initialize apples value to 1

if tomatoes == 24:

   watermelons +=4

elif tomatoes >= 12:

   watermelons +=2

else:  

   tomatoes<12

   apples +=1

   

print("Number of watermelons recieved: ",watermelons)  #displays the received number of watermelons

print("Number of apples recieved: ",apples )  #displays the received number of apples

8 0
3 years ago
Creating calendar events prevents individuals from being able to schedule a time to collaborate.
Yuliya22 [10]

Answer:

False because calender events help a person remeber when s/he has a event happening that day!

6 0
3 years ago
Which of the following ribbon tools would be most efficient for applying multiple
pshichka [43]

Answer:

Option A, Font Dialog Box

Explanation:

In order to make changes in the text formatting, the font setting in the dialog box can be used on the Ribbon's Home tab.

From the font settings in Word 2016, one can change the following change font color, size, style etc.

Hence, option A is correct

8 0
3 years ago
Other questions:
  • Tables draw your attention to specific information in a spreadsheet. Please select the best answer from the choices provided T F
    10·1 answer
  • Which of the following could be omitted from a company's AUP? A.Permissible lunchtime online activities B.Employees' home email
    15·2 answers
  • Suppose you have two tables: officer and gentleman. what question(s) can be asked by using the union operator?
    11·1 answer
  • Suppose I create a new kind of Java object, called "Kangaroo". Further suppose that at any given time, all instances of this new
    6·1 answer
  • A given application written in Java runs 15 seconds on a desktop processor. A new Java compiler is released that requires only 0
    9·1 answer
  • The first form of the rocket is believed have been developed in _?
    14·2 answers
  • Which format of image files can be inserted in html?​
    8·2 answers
  • Suppose that you have been asked to create an information system for a manufacturing plant that produces nuts and bolts of many
    12·1 answer
  • Who like anime becus i dooooo ( wrote this becuse i forgot what i was writing abot)
    13·1 answer
  • List 10 ways how can graphic design help the community
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!