Doubts about C records

0

Hello, I have a question on this exercise in the last sentence, it's asking to make a list but it does not say it's to register, but I'm putting the list inside the register to save but I do not know if that's what to do. / p>

  
  • Develop an algorithm to manage students in a course. Information about students and disciplines must be stored. About disciplines, you must store a list of them, containing your name, teacher's name, workload (30 or 60) and weekly schedule. The list of courses to be used can be found at the end of this document in the "Resources" section. They will not be modified during program execution.   As for the schedules, for simplicity, the classes take place only on weekdays and are organized in blocks of 2 hours. A subject may have one or two blocks per week. Each day of the week has 4 blocks. Block 1 always occurs at 8:00 AM and Block 2 occurs at 10:00 AM. Block 3 occurs at 1:00 p.m. and block 4 at 3:00 p.m. For example, algorithm discipline occurs on Tuesdays and Thursdays. In the second block of Tuesday and the third of the fifth. Consequently, algorithms will be given at 10:00 on Tuesday and at 1:00 pm on Thursday.   As for the students, store a list of them, for each student should contain: registration, name, surname, email, list of subjects enrolled (only the current semester) and hourly grid (created based on the blocks explained above).   For student lists, subjects and enrolled subjects of the student, you need to use vectors. To store the student's time grid, it is necessary to use matrices. For student and discipline, it is necessary to use records.
  •   

    Code:

    #include <stdio.h>
    #include <string.h>
    
        struct diciplinas
        {
    
        int codigo;
        char nome[20];
        char professor[20];
        int c_Horaria;
        char h_Semanal[30]; 
    
    
    
        };
    
        struct registro
        {
    
        int matricula;
        char nome[20];
        char sobrenome[20];
        char email[20];
        int l_Diciplinas[5];
    
        };
    
    
    void add_Aluno(struct registro al[3], struct diciplinas add_Dis[5]){
        char sairm;
        int dis,x,y=0,guarda[5];
        printf("\n\n");
        printf("--------------------------------------\n");
        printf("---Voce selecionou adicionar aluno.---\n");
        printf("--------------------------------------\n");
        printf("Lista de diciplinas\n");
                    //mostra a lista das materias
        for(x=0; x<3; x++){
            printf("Digite seu nome:");
            fflush(stdin);
            gets(al[x].nome);
            printf("Digite seu Sobrenome:");
            gets(al[x].sobrenome);
            strcat(al[x].nome,al[x].sobrenome);
            printf("Digite sua Matricula:");
            scanf("%d",&al[x].matricula);
            printf("Digite seu e-mail:");
            gets(al[x].email);
            printf("Digite O codigo das diciplinas que voce deseja se matricular\n");
            for(y=0; y<5; y++){
            scanf("%d",&al[x].l_Diciplinas);
    }
    
            }   
        }
    
    
    
    
    
    
    main(){
    
        struct diciplinas curso[5];
        struct registro alunos[3];
        int escolha;
        char grade[5][5];
        curso[0].codigo=122;
        strcpy(curso[0].nome,"Algoritimos");
        curso[0].c_Horaria=60;
        strcpy(curso[0].h_Semanal,"Segunda bloco 1 e terca bloco 2");
    
        curso[1].codigo=127;
        strcpy(curso[1].nome,"Estrutura de dados");
        curso[1].c_Horaria=60;
        strcpy(curso[1].h_Semanal,"terca bloco 3 e quarta bloco 4");
    
        curso[2].codigo=132;                                                //dados salvos
        strcpy(curso[2].nome,"Sistemas Operacionais A ");
        curso[2].c_Horaria=60;
        strcpy(curso[2].h_Semanal,"Terca bloco 3 e Quinta bloco 2");
    
        curso[3].codigo=143;
        strcpy(curso[3].nome,"Padroes de Projeto");
        curso[3].c_Horaria=30;
        strcpy(curso[3].h_Semanal,"Sexta bloco 2");
    
        curso[4].codigo=135;
        strcpy(curso[4].nome,"Banco de dados ll");
        curso[4].c_Horaria=60;
        strcpy(curso[4].h_Semanal,"Quarta bloco 3 e sexta bloco 2");
    
        grade[0][0]="Segunda";
    
    
    
        printf(" -----------------------\n");
        printf(" ------Bem Vindo!!------\n");
        printf(" -----------------------\n");
        printf("Escolha uma das opcoes abaixo\n");
        printf("1. Adicionar aluno\n");
        printf("2. Consultar aluno\n");
        scanf("%d",&escolha);
        if(escolha == 1){
            add_Aluno(alunos,curso);
          }else if(escolha == 2){
    
        }
    
    
    }
    
        
    asked by anonymous 13.06.2018 / 01:56

    0 answers