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
Stolb23 [73]
3 years ago
11

#include

Computers and Technology
1 answer:
Artist 52 [7]3 years ago
3 0

Answer:

#include <iostream>

#include <vector>

using namespace std;

int main() {

const int NUM_VALS = 4;

vector<int> testGrades(NUM_VALS);

int i = 0;

int sumExtra = -9999; // Assign sumExtra with 0 before your for loop

testGrades.at(0) = 101;

testGrades.at(1) = 83;

testGrades.at(2) = 107;

testGrades.at(3) = 90;

/* Your solution goes here */

sumExtra = 0;

for(i = 0; i <= testGrades.size() -1; i++){

   if(testGrades.at(i) > 100){

       sumExtra = sumExtra + (testGrades.at(i) - 100);

   }

}

cout << "sumExtra: " << sumExtra << endl;

return 0;

}

Explanation:

Looks like you almost solved the question. I highlighted the parts you have been missing above.

In order to use vectors in C++, you need to add the vector library at the beginning of the program, #include <vector>

In order to initialize the vector, you need to specify its type inside <int>, since we work with the integers in the question the type must be <em>int</em>

You might be interested in
Jump to Question: Fill in the blanks below: The flow of electricty is similar to the movement of water through a pipe. The movem
HACTEHA [7]

The answer is;

Current  

Voltage  

Power/Wattage  

Circuit

Water moving through pipes is like electricity flowing in a circuit. The flow of electricity is an actual flow of electrons. That movement of electrons is what is known as current. Think of current as the volume of water flowing through a water pipe. The electrons need some force or pressure to move, and so is water in a pipe. The voltage is that electromotive force; the pressure that pushes the electrons in a system. The power measured in Watts is the rate at which the energy is consumed. For the current to flow the circuit must be complete. Otherwise we cannot say that we have power if the circuit is not closed.

5 0
3 years ago
The set of coordinating colors applied to backgrounds, objects, and text in a presentation is called:
Sonja [21]

Answer:

theme colors

Explanation:

As said, a group of colors that are used to format text and objects in a document. When you open the Color menu, these colors determine what you see.

3 0
2 years ago
One easy way to tell if a cell contains a formula instead of data is to click on the cell and look at the formula bar to
joja [24]

Answer:

E

Explanation:

i know

3 0
2 years ago
Read 2 more answers
When do you use FTP?
Sergeeva-Olga [200]
FTP (File Transfer Protocol) can be used for a variety of tasks. For instance, webmasters using FTP for pushing updates/files to their websites can provide easy and straightforward changes to their services without the need to physically transfer files onto the host server. FTP should be used when you must update a file or files on a host server for a variety of reasons and you do not have access to the host server physically. However, FTP also has some inherent security risks which is why some webmasters/hosts chose to opt out of pushing updates through FTP in favour of physical file transfer.
5 0
3 years ago
Read 2 more answers
What products use fabric manipulation
Komok [63]
The fabric satin is good for fabric manipulation.
8 0
3 years ago
Other questions:
  • Scratch and grinding marks on sedimentary rocks indicate which type of environment?
    6·1 answer
  • Can anyone help me with getting bash ubuntu on windows setup?
    15·1 answer
  • The first computer (the eniac was how big
    8·1 answer
  • What are three steps to use to research relevant information on the internet? (Site 1)
    13·2 answers
  • What category of sensory receptors are sensitive to touch sound and motion?
    10·1 answer
  • What is the term for a Web site that allows users to access and interact with software from any Internet-connected computer or d
    11·1 answer
  • Vegetable farming is a good source of income explain this statement<br>​
    5·1 answer
  • This is a tableware use to serve the main dish
    11·1 answer
  • A debate about city schools are more better than village schools​
    8·1 answer
  • Question 7 Consider the following code:
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!