Array 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. 324758.2040686.qx3zqy7 1 #include 2 3 int main(void) { const int NUM VALS = 4; int testGrades[NUM_VALS]; int i; int sumExtra = -9999; // Assign sumExtra with 0 before your for loop 4 6 7 8 for (i = 0; i < NUM_VALS; ++i) { scanf ("%d", &(testGrades[i])); } 9 10 11 12 13 /* Your solution goes here */ 14 printf("sumExtra: %d\n", sumExtra); return 0; 15 16 17

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter8: Arrays
Section: Chapter Questions
Problem 5RQ
icon
Related questions
Question
100%
Array 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.
324758.2040686.gx3zgy7
1 #include <stdio.h>
2
3 int main(void) {
const int NUM VALS = 4;
int testGrades[NUM_VALS];
int i;
int sumExtra = -9999; // Assign sumExtra with 0 before your for loop
4
6.
7
8
for (i = 0; i < NUM_VALS; ++i) {
scanf("%d", &(testGrades[i]));
}
9
10
11
12
13
V* Your solution goes here */
14
printf("sumExtra: %d\n", sumExtra);
return 0;
15
16
17
Transcribed Image Text:Array 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. 324758.2040686.gx3zgy7 1 #include <stdio.h> 2 3 int main(void) { const int NUM VALS = 4; int testGrades[NUM_VALS]; int i; int sumExtra = -9999; // Assign sumExtra with 0 before your for loop 4 6. 7 8 for (i = 0; i < NUM_VALS; ++i) { scanf("%d", &(testGrades[i])); } 9 10 11 12 13 V* Your solution goes here */ 14 printf("sumExtra: %d\n", sumExtra); return 0; 15 16 17
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning