#include #include typedef struct { char firstName[25]; char middleName[25]; char lastName[25]; } NameType; typedef struct { NameType name; char email[40]; int labs[7]; double midterm1; double midterm2; double lExam1, lExam2; double subtotal; } StudentRecord; void printName(NameType record){ printf("%s, %s %s\n", record.lastName, record.firstName, record.middleName ); return; } void printReport(StudentRecord record) { int i; printf("=========================================\n"); printName(record.name); printf("\n\n"); printf("Labs:\n"); for (i=0;i<7;i++) { printf(" Lab %d: %d\n",i, record.labs[i]); } printf("\n\n"); printf("Midterms : #1: %f #2: %f\n", record.midterm1, record.midterm2); printf("Lab Exams: #1: %f #2: %f\n", record.lExam1, record.lExam2); printf("------------------------------------------\n"); printf("\nSubtotal: %f\n\n",record.subtotal); printf("=========================================\n"); return; } int main() { int i; NameType student; StudentRecord report; strcpy(student.firstName, "John"); strcpy(student.middleName,"Elizabeth"); strcpy(student.lastName, "Yosef"); report.name = student; report.midterm1 = 50; report.midterm2 = 85; report.lExam1 = 20; report.lExam2 = 0; report.subtotal = 70; for (i=0;i<=7;i++) { report.labs[i]= 10*i + 7; } strcpy(report.email, "jeYosef@calpoly.edu"); printReport(report); return 0; }