EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
Bartleby Related Questions Icon

Related questions

Question
100%

Hi,

I need help with this C programming question.

Thanks a lot 

1.
The following code is for calculating the mean value of 6 grades and has five
errors/warnings. Identify and correct the errors/warnings.
1
#include <stdio.h>
2
3
#define SIZE 6;
4
double mean Value (int grades [] , size_t size)
7
int main (void)
8
{
10
int grades []
{98, 87, 92, 67, 74, 88};
11
12
double average;
13
14
average = meanValue (grades, SIZE);
15
16
printf ("Mean value of grades is %.2d\n", average);
17
18
19
20
double mean Value (int grades [] , int size)
21
{
22
int total = 0;
23
for (size t i = 0; i < size; i++) {
total += grades [i];
24
25
26
}
27
28
return total/size;
29
30 }
expand button
Transcribed Image Text:1. The following code is for calculating the mean value of 6 grades and has five errors/warnings. Identify and correct the errors/warnings. 1 #include <stdio.h> 2 3 #define SIZE 6; 4 double mean Value (int grades [] , size_t size) 7 int main (void) 8 { 10 int grades [] {98, 87, 92, 67, 74, 88}; 11 12 double average; 13 14 average = meanValue (grades, SIZE); 15 16 printf ("Mean value of grades is %.2d\n", average); 17 18 19 20 double mean Value (int grades [] , int size) 21 { 22 int total = 0; 23 for (size t i = 0; i < size; i++) { total += grades [i]; 24 25 26 } 27 28 return total/size; 29 30 }
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage