Computers and Technology
Computers and Technology, 04.04.2020 10:58, zero101

#include
#include
using namespace std;

/*
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.
*/

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 */
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;
}

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 04:30, minecrafter3882
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe what
Answers: 1
image
Computers and Technology, 24.06.2019 10:00, shrafe
Which two technologies support the building of single-page applications?
Answers: 2
image
Computers and Technology, 24.06.2019 15:30, jhony70
What type of forensic evidence was recovered during the bomb set off at the new mexico facility on the video that was similar to the evidence obtained at the boston bombings and how did the evidence allow the researchers to connect other pieces of evidence to the same bomb?
Answers: 2
image
Computers and Technology, 24.06.2019 21:30, asimms8504
Suppose a router has built up the routing table shown in the table. subnet number 128.96.39.00 28.96.39.128 128.96.40.00 192.4.153.0 default) subnet mask 255.255.255.128 255.255.255.128 255.255.255.128 255.255.255.192 nexthop interface 0 interface 1 r2 r3 r4. the router can deliver packets directly over interfaces 0 and 1, or it can forward packets to routers r2, r3, or r4. describe what the router does with a packet addressed to each of the following destinations: (a) 128.96.39.10 (b) 128.96.40.12 (c) 128.96.40.151 (d) 192.4.153.17 (e) 192.4.153.90
Answers: 3
Do you know the correct answer?
#include
#include
using namespace std;

/*
Vector testGrades contains...

Questions in other subjects: