Early Steps Basic School requires an application that will help teachers to record the attendance of students. The application should provide the user with a menu with options to mark register, view register and exit.
The application should prompt the user for the amount of attendance records to be entered when the mark register option is selected, the application should be able to process a maximum of twenty (20) records. An attendance record consists of the student id, name, number of days present, number of days absent. The application should display all attendance records when the view register option is selected. The application should continue to execute/run until the user selects the exit option from the menu.
Expectations:
Your application should include:
1. Use of Parallel Arrays / Lists
2. Ability to process a maximum of 20 register records.
3. Use 'Header Record Logic' with each run of the program.
4. One run of the program should continue until the user selects the Exit menu option.
5. When the menu option '2. View Register' is selected the records currently entered should be displayed.
What I have tried:
#include <stdio.h>
#include<conio.h>
int main()
{
int menu;
char attendance;
int attendance_rec;
char mark_register;
char view_register;
int size= 20;
int maxChar= 50;
int name[maxChar][size];
int student_ID[size];
int nop[size], noa[size];
printf("Early Step Basic School");
printf("Please select from the following menu:");
printf("\n1. Mark Register\n2. View Register\n3. Exit");
scanf("%d", menu);
if (menu==1){
printf("Please enter number of attendance records being requested. Maximum 20");
scanf("%d", attendance_rec);
fflush(stdin);
printf("Please enter student attendance status (P)resent and (A)bsent: ");
scanf("%c", attendance);
}
if (menu==2){
printf("Please see attendance records");
}
if (menu==3){
break;
}
for(int i= 0; i < size; i++)
{
printf("%d", name[i], "%d", student_ID[i], "%d", nop[i], "%d", noa[i]);
}
break;
return 0;
}