Question: Write a program that uses a structure to store the following data: Member Name Description Name Student Name (string) IdNum Student ID Number (int) Tests

Write a program that uses a structure to store the following data:

Member Name Description

Name Student Name (string)

IdNum Student ID Number (int)

Tests Pointer to an array of test scores (double*)

Average Average test score (double)

Grade Course grade (char)

Two example text files called student1.txt and student2.txt (attached with this document on black board) that contain information of several students are given to you. The first column is the name of the student (assume only one word), the second column is the student ID number; the remaining columns indicate the scores in different tests made by the student. In student1.txt, each student has 6 test scores, while in student2.txt each student has 5 test scores. The program should first ask the user the name of the file, how many test scores each student takes and how many students are there in the file. Depending on the number of students it should dynamically allocate an array of student structures. The program should read the file and fill up the three members (Name, IdNum, and Tests) of the each student structure. Each structures Tests member should point to a dynamically allocated array that holds the test scores. After each student structure has been filled up, the program should calculate the average score of each student and store it in average member of each structure. The course grade should be computed based on the following basis:

Average Test Grade Grade

90-100 A

80-89 B

70-79 C

60-69 D

59 or below F

The course grade should be stored in the Grade member of each structure. Once this data is calculated, a table should be displayed on the screen listing each student (name, ID number, average test score, and course grade) in descending order of their average test score. How to submit your solutions:

student1.txt file

student1 18611 72 75 65 89 64 84 student2 20055 71 71 67 66 63 89 student3 22509 80 68 94 61 63 99 student4 15274 95 97 85 68 95 91 student5 16039 94 83 73 65 75 98 student6 14851 89 64 90 77 70 82 student7 22814 85 62 94 91 68 81 student8 19371 97 99 92 79 80 83 student9 18456 90 84 61 78 62 91 student10 14097 72 60 75 71 93 84 student11 22261 77 67 95 74 88 87 student12 17521 95 86 98 96 71 83 student13 21993 74 94 65 92 82 91 student14 19234 99 77 97 100 93 81 student15 21864 84 84 96 93 60 98 student16 16658 100 69 77 89 95 94 student17 20606 73 83 95 90 98 96 student18 14984 75 91 83 63 88 98 student19 16717 86 95 74 68 91 88 student20 16410 99 71 70 68 78 80 student21 22106 91 97 79 73 71 94 student22 22479 100 91 96 79 85 92 student23 17459 83 68 66 80 76 91 student24 19222 83 83 92 88 87 98 student25 19567 90 96 76 93 87 89 student26 14810 100 92 94 68 83 99 student27 18920 87 71 77 77 87 97 student28 23202 85 84 78 93 77 81 student29 22386 95 100 66 85 71 93 student30 20966 88 76 81 92 64 90 

student2.txt

student1 14658 77 92 96 90 95 student2 18822 92 60 61 89 72 student3 13855 84 67 62 67 72 student4 16732 89 75 74 66 81 student5 22005 84 72 60 66 83 student6 14810 97 97 60 95 74 student7 22448 71 85 82 72 86 student8 13107 100 76 81 62 96 student9 14721 77 72 76 84 80 student10 13420 98 69 60 80 70 student11 22858 90 65 68 67 98 student12 15096 92 70 64 76 63 student13 13872 79 88 63 60 84 student14 16506 71 93 67 64 92 student15 19802 89 82 96 100 82 student16 22220 74 77 83 61 76 student17 18514 97 76 71 70 73 student18 20370 74 60 94 74 65 student19 19665 76 61 68 70 87 student20 19038 93 86 81 90 78 student21 22417 99 84 91 86 95 student22 14905 73 85 80 70 67 student23 14445 90 80 81 74 88 student24 18691 95 92 96 67 90 student25 18347 88 66 60 74 81 student26 20866 74 73 79 75 90 student27 20790 82 90 70 89 76 student28 15132 99 86 79 67 93 student29 23195 92 87 98 84 97 student30 21615 94 76 85 68 74 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!