Click here to Skip to main content
15,881,413 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
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:

C
#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;
}
Posted
Updated 24-Nov-22 20:09pm
v2
Comments
OriginalGriff 25-Nov-22 2:01am    
And?
What does it do that you didn't expect, or not do that you did?
What have you tried to do to find out why?
Are there any error messages, and if so, where and when? What did you do to make them happen?

What have you tried?
Where are you stuck?
What help do you need?

This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.

Use the "Improve question" widget to edit your question and provide better information.

1 solution

Try with starting some Learn C tutorial or some video tutorial.

Take care that you fullfill every point in your recommendation list.

some tips: use functions and structs with understandable names and install some IDE like Visual Studio..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900