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
murzikaleks [220]
4 years ago
11

Write a for loop that sets each array element in bonusScores to the sum of itself and the next element, except for the last elem

ent which stays the same. Be careful not to index beyond the last element. Ex: If bonusScores = [10, 20, 30, 40], then after the the loop bonusScores = [30, 50, 70, 40] The first element is 30 or 10 + 20, the second element is 50 or 20 + 30, and the third element is 70 or 30 + 40. The last element remains the same.

Computers and Technology
2 answers:
Lilit [14]4 years ago
7 0

Answer:

#Python

1. bonusScores = [10, 20, 30, 40]

2. print("Before",bonusScores)

3. for i in range(len(bonusScores)-1):

4.     bonusScores[i] = bonusScores[i] + bonusScores[i+1]

5. print("After",bonusScores)

Explanation:

  1. On the first line, we define our array bonusScores
  2. On line two we print how this array looks like before making any changes
  3. On line 3 we create a for loop to iterate over the length of the array omitting the last element (len(bonusScores)-1)
  4. On line four we sum the current element with the next one
  5. On line five we print the final result

Lesechka [4]4 years ago
3 0

Answer:

The C program is commented in the explanation

Explanation:

I am going to write a C program, a function that receives an array and the array length.

I can update each position with a for loop. This loop is going to end at the next to lastPosition(so, i < n-1);

void sum(int * bonusScores, int n){

int i;

for(i = 0; i < n-1; i++){

bonusScores[i] = bonusScores[i] + bonusScores[i+1]

}

}

This should do it :)

You might be interested in
What are some differences between film and digital cameras?
inna [77]

The main difference is that digital cameras don't have film but they use memory cards instead, also while in film cameras the ligh sensitive part is the film, in digital cameras there is the CCD/CMOS sensor which captures the light and transforms it into a picture.

google


4 0
3 years ago
After Brooke has helped Simon to resolve his original problem, Simon asks her about another linked workbook he has received. The
amm1812

Answer:

The answer is "The working book can be opened and the version Links dialogue box will press Continue button".

Explanation:

As we knew, the workbook is a set of files, in which one or more worksheets are uses. All the file of the workbook is defined in the form of the sheets, like Sheet1, Sheet2, and so on, in which we can also change the name of the sheet.

  • To solve another workbook problem the firstly the Simon open the workbook by providing the appropriate link.
  • This file Includes the source file, that doesn't have published, and  he also wants to use the workbook with the new source file values.
7 0
3 years ago
"How has graphic design changed through time?"
noname [10]

The main purpose behind graphic designing is to communicate, The different colors, shapes and patterns used in graphics aim to deliver a meaningful message, which sometimes is hidden. Back in the time, graphic designs usually portrayed what was going on at that time, for instance wars, with larger icons and catchy slogans. Over the time, the graphic designs have evolved where psychedelic, geometrical and monochromatic designs have gained more popularity, with different typographic styles to follow. Moreover, since the world has been taken over by technology in a storm, we get to see some drastic changes in the photography styles, use of color balances with minimal designs and subtle tones.

8 0
3 years ago
Fromwhich object do you ask for DatabaseMetaData?ConnectionResultSetDriverManagerDriver
icang [17]

Answer:

Connection

Explanation:

We can get DatabaseMetaData from the java.sql.Connection object.

The relevant API call is Connection.getMetaData().

This returns an object of the type DatabaseMetaData.

Some of the methods available as part of the DatabaseMetaData object are:

  • getDatabaseMajorVersion()
  • getDatabaseMinorVersion()
  • getDriverName()
  • getDriverVersion()
  • isReadOnly()
  • getCatalogs()
  • getTables()
  • supportsBatchUpdate()
  • supportsUnion()
8 0
3 years ago
An organization is assigned a Class-C network 200.120.80.0 and wants to form subnets for its threedepartments: D1 (60hosts), D2
Nataliya [291]

Answer:

D1= 60 HOSTS

network address - 200.120.80.64/26

subnet mask -255.255.255.192/26

D2 = 90 HOSTS

network address - 200.120.80.0/25

subnet mask -255.255.255.128/25

D3 = 90 HOSTS

network address - 200.120.80.128/25

subnet mask -255.255.255.128/25

5 0
4 years ago
Other questions:
  • What will be the biased exponent of 1,100.1? <br> A:130<br> B:127<br> C:-127<br> D:2^3
    12·2 answers
  • Wi-Fi is all around us. Is there any downside to its pervasiveness?
    11·1 answer
  • As you move the click and type pointer around the document, the icon changes to represent ____________________ that will be appl
    10·2 answers
  • CAPTCHAs can be used as a form of signature to create a valid contract in e-commerce. True False
    6·2 answers
  • Approximately what percent of desktop PCs are used for work-related purposes?
    13·2 answers
  • Alright, don't judge me, this is a question that involves my Childhood game PvZ GW 2. So I noticed mods and stuff that get uploa
    12·2 answers
  • A computer "nibble" consists of four "bits," each bit being either a 0 or a 1. If characters are represented using a code that u
    12·1 answer
  • What section in an ethernet frame will you find a Virtual Local Area Network (VLAN) header?
    6·1 answer
  • Is this right? I’m not sure
    15·1 answer
  • Why are digital signals an accurate and reliable way to record and send information?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!