Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 #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[j].id) { tId= s[i].id; tPer= s[i].per;

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions