Question: Directions: Please complete the following assignment to signify your completion of Unit 13. All programming projects need to be completed and submitted electronically, following the
Directions:
Please complete the following assignment to signify your completion of Unit 13. All programming projects need to be completed and submitted electronically, following the Electronic Submission Guidelines discussed in class. Please cherry-pick from your solution folder and submit just the .c files you created as well as the executable file created by your development environment.
Background:
The purpose of this assignment is to get practice working with structures. A structure allows us to group together different kinds of data and develop a brand new data type. This kind of flexibility makes C very powerful.
Project 8: Structure Programming Given the following starter code:
#includeSamoStudent selectHigherGPA( SamoStudent student1, SamoStudent student2 ); /* return the student with the higher gpa */ SamoStudent selectLowestHouseValue( SamoStudent student1, SamoStudent student2 ); /* return the student with the lower house value */ int equal( SamoStudent student1, SamoStudent student2 ); /* return 1 if the two students are the same, 0 otherwise */ struct SamoStudent { char name[ 50 ]; char houseValue; char birthday[ 50 ]; double gpa; }; int main () { SamoStudent you; /* an example of a SamoStudent */ strcpy( you.name, "Sam Student" ); you.houseValue = 'H'; strcpy( you.birthday, "01/01/2000" ); you.gpa = 3.751; SamoStudent me; /* an example of a SamoStudent */ strcpy( me.name, "Howard Stahl" ); me.houseValue = 'O'; strcpy( me.birthday, "10/01/1965" ); you.gpa = 3.4159; SamoStudent gpa = selectHigherGPA( me, you ); SamoStudent house = selectLowestHouseValue( me, you ); int value = equal( me, you );
printf( "gpa's name: %s ", gpa.name ); /* should print Sam Student */ printf( "house's name: %s ", house.name ); /* should print Sam Student */ printf( "equal? %d ", value ); /* should print 0 */ return 0; }
Please complete the three different functions that have been stubbed out. By doing so, you will be working with structures and structure arguments.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
