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
Marat540 [252]
3 years ago
7

C++ Proagram

Computers and Technology
1 answer:
lions [1.4K]3 years ago
5 0

Answer:

Replace /* Your solution goes here */

with

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

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

}

Explanation:

In C++, the index of an array starts from 0 and ends at 1 less than the size of the array;

Using the analysis in the question, the above code (in the answer section) iterates from the index element (element at 0) to the second to the last element (element at size - 2)';

This is to ensure that the element of the array only adds itself and the next element;except for the last index which remains unchanged

The following operation is done in each iteration.

When i = 0,

<em>bonusScores[0] = bonusScores[0] + bonusScores[0+1]; </em>

<em>bonusScores[0] = bonusScores[0] + bonusScores[1]; </em>

<em>bonusScores[0] = 10 + 20</em>

<em>bonusScores[0] = 30</em>

When i = 1,

<em>bonusScores[1] = bonusScores[1] + bonusScores[1+1]; </em>

<em>bonusScores[1] = bonusScores[1] + bonusScores[2]; </em>

<em>bonusScores[1] = 20 + 30</em>

<em>bonusScores[1] = 50</em>

<em />

When i = 2,

<em>bonusScores[2] = bonusScores[2] + bonusScores[2+1]; </em>

<em>bonusScores[2] = bonusScores[2] + bonusScores[3]; </em>

<em>bonusScores[2] = 30 + 40</em>

<em>bonusScores[2] = 70</em>

<em />

<em>This is where the iteration stops</em>

You might be interested in
Translation of a file into a coded format that occupies less space than the original file is called
Dafna1 [17]
I believe Its called data compression.
8 0
3 years ago
Word 2013 opens, by default, on a blank document?
Lina20 [59]
Word 2013 opens on a blank document by default
6 0
3 years ago
Read 2 more answers
HELP PLEASE NOW ASAP BRAINLIEST
charle [14.2K]
<span>Josie lives in an area where there are frequent power cuts. She should use a UPS (Uninterruptible Power Supply). It protects against damage to a computer's hard drive (data) in case of a sudden shutdown.

Hope this helps!</span>
7 0
4 years ago
Read 2 more answers
"Using the printf method, print the values of the integer variables bottles and cans so that the output looks like this: Bottles
Anika [276]

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       

       System.out.println("Enter the number of bottles and cans:");

       int numberOfbottles = in.nextInt();

       int numberOfcans = in.nextInt();

       System.out.printf("Bottles: %8d\n", numberOfbottles);

       System.out.printf("Cans:    %8d\n", numberOfcans);

}

}

Explanation:

Ask user to input the number of bottles and cans using Scanner class

Print the results so that the numbers to the right line up (Since we know that the numbers have at most 8 digits, we can use %8d in printf. Also, be aware that how printf statements are written so that the numbers line up)

6 0
3 years ago
In order to get a great sports photograph, you need to do what?
Alik [6]
The answer is Anticipate the action.  <span>In order to get a great sports photograph, you need to anticipate the action.  </span><span>A big part of </span>sports photography<span> is </span>anticipating action.  <span>The photographer will be able to anticipate the action so that the camera will be pointed in the right direction to capture the decisive moments on film</span>
8 0
4 years ago
Read 2 more answers
Other questions:
  • B. Find Addition of Binary Numbers: 1100112 + 11012
    11·1 answer
  • While ________ is centered on creating procedures, ________ is centered on creating objects. Procedural programming, class progr
    10·1 answer
  • Answer these two if u can❤️
    5·2 answers
  • From the following list choose all the tasks an operating system performs.
    5·2 answers
  • PLEASE HELP ME ASAP ;(
    15·1 answer
  • The column boundary, the border to the right of a column, can be dragged until a row is at a desired height. true or false
    14·1 answer
  • Kareem is working on a project for his manager. He has a few questions for a co-worker who he knows is knowledgeable on the subj
    7·1 answer
  • Match the image to the view type in a presentation program. scroll bar tool bar status bar menu bar provides an array of buttons
    10·2 answers
  • Which statement best describes 'abstraction'? *
    5·1 answer
  • 2.3 Code Practice: Question 1
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!