This is my college project..i have tried it a lot of times but compilation keeps failing and i have run out of idea...please somebody if u see this..please give a helping hand...i appreciate very very much if someone could help...the question is as follows:
Define a structure with the following data members:
studid (use char array of 10 elements to store the Student ID)
lectatt (use int array of 14 elements to store 14 weeks of lecture attendance).
Use the preprocessor directive to define constants for elements in both arrays.
In main() function :
Declare an array of structure variable mystudents with 7 elements. Use the preprocessor directive to define the constant for this array also.
Declare a pointer to a file called input_file.
Declare and initialize the following arrays of variable.
o hours_attended (total hours attended for each students)
o att_percentage (the percentage of attendance based on the assumption that students need to attend 2 hours of lecture every week)
Use the fopen() function call to open a file named attendance.dat for read only and assign the return value the pointer of the input_file.
Check whether the attendance.dat can be open or not.
If the file can be opened, use a nested for loop the insert data in the array of structure mystudents.
o Use the outer for loop to read the Student ID and insert the data into the structure array.
o Use the inner for loop to read the attendance where each number represent the number of hours attended.
Close the input file.
Create another nested for loop just like the first nested loop to get the total hours attended and get the percentage (assuming that students need to attend 2 hours every week for 14 weeks).
Use the last for loop to display the Student ID and the attendance percentage for each student.
Thanking you in advanced, and best regards,

C programming Student

