Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In c lang (25 points) ahvrite a function max_pos that finds the position of the maximum element in a one-dim number array. b) In AYBU-CENG
In c lang
(25 points) ahvrite a function max_pos that finds the position of the maximum element in a one-dim number array. b) In AYBU-CENG department, let's say; every student takes 7 courses, in their first year first semester, whose credits are 5,5,4,1, 3, 3 and 2 respectively. Write a C program that reads the student id and the letter grades of all 7 courses from the courses.txt for each student; calculates the student's GPA for that semester; writes the student id and the GPA to an output file named gpa.txt; and by using the function max_pos displays the maximum gpa and the id of the student that gets the maximum gpa on the screen as in the example run. HINT: Keep the course credits in an array. Convert the letter grade to grade point equivalent (using a switch statement), Multiply each grade point with its credits, Find their sum, Divide the sum to the sum of the credits of that semester. courses.txt 1111 A A-C C+ A-A-A 2222 D+ A-B-CC-AA- 3333 FD C- CAA-B 4444 A-BA A-C-D D+ 5555 B-C-D+D FAD+ 6666 D+ C- C+ B-B B+ A 7777 B- A- C+ C+ B+ A-C- 8888 A-B+ C C+B D+ F Letter Grade Point A 4.00 A-3.70 B+ 3.30 B 3.00 B-2.70 C+2.30 C 2.00 C- 1.70 D+ 1.30 D 1.00 F0.00 gpa.txt 1111 3.41 2222 2.71 3333 1.93 4444 2.78 5555 1.86 6666 2.28 7777 2.95 8888 2.53Step 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