Question
Instructions: Modify the grade book program from Assessment 3 to use a custom struct to hold the student's ID number and the percentage score for
Instructions:
Modify the grade book program from Assessment 3 to use a custom struct to hold the student's ID number and the percentage score for each item in the grade book. The program should accept the entry of ID numbers and percentage grades (0100) until the user signals that he or she is done entering grades. The program should then print out the ID numbers and grades entered by the user, sorted by ID number. Again, be sure to format the code properly and provide comments in the C code. _____________________________________________________ My problem(s): Errors: |43|warning: assignment makes integer from pointer without a cast [enabled by default]| |44|warning: assignment makes integer from pointer without a cast [enabled by default]| |46|error: incompatible types when assigning to type 'int[100]' from type 'int *'| |47|error: incompatible types when assigning to type 'int[100]' from type 'int *'| |49|error: incompatible types when assigning to type 'int[100]' from type 'int'| |50|error: incompatible types when assigning to type 'int[100]' from type 'int'| _____________________________________________________ Problem(2): This is an alteration of other assisted codes provided. Please note 1 very important point- I do not want to ask the user to enter anything BUT the ID 1st, if the ID is -1 (user indicated quit), then break, or else enter Grade. Then SORT on ID number.
Here is my code: #include
struct student { int id[100]; int per[100]; }s[100];
int main() { int x, a=0, ctr; int n;
printf("Grades Entered");
for(x=0;x<100;x++) { printf("Enter ID Number: "); scanf("%d", &s[ctr].id); { if(ctr !=-1) { printf("Enter Grade: "); scanf("%d", &s[ctr].per); } if(ctr==-1) { break; } } }
int tId, tPer; int i=0, j=0;
for(i=0;i
s[i].id= s[j].id; s[i].per= s[j].per;
s[j].id= tId; s[j].per= tPer; } } printf(" Student ID\tGrade");
for(i=0;i }
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