subject

Vector testGrades contains NUM_VALS test scores. Write a for loop that sets sumExtra to the total extra credit received. Full credit is 100, so anything over 100 is extra credit. Ex: If testGrades = {101, 83, 107, 90}, then sumExtra = 8, because 1 + 0 + 7 + 0 is 8.

#include
#include
using namespace std;

int main() {
const int NUM_VALS = 4;
vector 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 */

cout << "sumExtra: " << sumExtra << endl;
return 0;
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
3. (6 pts) internally in the computer, with few exceptions, all numerical computation is done using binary numbers. output, however, often uses ascii, which is formed by appending 011 to the left of a bcd code. thus, an algorithm that directly converts a binary integer to a bcd integer is very useful. here is one such algorithm 1) draw lines to the left of the binary number to bound the expected bcd decades. (each decade is a group of 4 bits.) move the binary number one bit to the left. add 0011 to each bcd decade containing a binary value> 0100 repeat steps 2-3 until the last bit in the binary number has been moved into the least significant decade position. (note that when the last bit has been shifted into bcd decade, step 3 is not repeated.) read the bcd result. 2) 3) 4) 5) a) execute the algorithm for the binary number 1101101 b) execute the algorithm for the binary number 01110101110 4. (4 pts) represent the decimal number 3568 in bcd; excess-3 code; ascil; and hex.
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Me ! evelyn is a manager in a retail unit. she wants to prepare a report on the projected profit for the next year. which function can she use? a. pmt b. round c. division d. what-if analysis
Answers: 2
question
Computers and Technology, 23.06.2019 13:50
Explain how email technologies enable the exchange of messages between users. find out the typical parts of an email address and explain each part.
Answers: 1
question
Computers and Technology, 24.06.2019 02:30
Write the pseudo code for this problem based on what you learned from the video. the purpose is to design a modular program that asks the user to enter a distance in kilometers, and then converts that distance to miles. the conversion formula is as follows: miles = kilometers x 0.6214
Answers: 3
You know the right answer?
Vector testGrades contains NUM_VALS test scores. Write a for loop that sets sumExtra to the total ex...
Questions
question
Mathematics, 13.08.2019 04:30
Questions on the website: 13722359