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
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
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F877d147a-40f9-47d8-b25c-41d77d376d71%2F6befb2a5-7e14-4046-ac41-d2442b8c96d2%2F09795nh_processed.png&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage