Can someone help me write this code? I don\'t get how to use astructure. I\'m tr
ID: 3618563 • Letter: C
Question
Can someone help me write this code? I don't get how to use astructure. I'm trying to generate random numbers for the hw1,hw2,quiz1,quiz2,midterm, and final variables. Can someone give mesome hints on what to do? Thanks.#include <stdio.h>
#include <stdlib.h>
// User-defined variables
struct grade {
int student_id;
double hw1;
double hw2;
double quiz1;
double quiz2;
double midterm;
double final;
double overall_grade;
char letter_grade;
};
int
main(void)
{
struct grade sgrade[15];
double average[7];
int i;
int j;
//Prints the top header for the chart
printf(" # HW1 HW2 Quiz1 Quiz2 Midterm Final Total Grade");
for(j=1;j<16;j++)
{
printf(" %d",j);
for(i=0;i<1;i++)
{
hw1 = 50.0+rand() % 50;
}
}
printf(" ");
system("pause");
return(0);
}