Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a C program to do the following tasks: 1. Create file midterm .txt contains at most 100 positive integers (the midterm grades) , one
Write a C program to do the following tasks:
1. Create file midterm.txt contains at most 100 positive integers (the midterm grades), one grade per line.
2. Declare an integer array call it Grades to hold the midterm grades.
3. Fill the elements of the array Grades from the file midterm.txt.
4. Write a function call it statistic, which accepts the array Grades and its size as input parameters, and has two pointers as output parameters, the two pointers will be used to return the average of the midterm, and the maximum grade.
5. Let the function returns(by statement return) how many students got the maximum grade
6. The function prototype int statistic(int [ ], int, float avg*, int max *);
7. Let the function calculate the average, the maximum grade for the grades in the array marks.
8. Printout the average, maximum grade and how many students got the maximum grade
in the main function using the following format exactly:
Average = 0000.00
Maximum grade = 0000
Number of Maximum grades= 0000
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started