Advertisement
Guest User

Untitled

a guest
Jun 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.47 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. struct aluno{
  6.     int mat;
  7.     char nome[81];
  8.     float notas[3];
  9.     float media;
  10. };
  11.  
  12. typedef struct aluno Aluno;
  13.  
  14. struct turma{
  15.     char id; /* caractere que identifica a turma, por exemplo, A ou B */
  16.     int vagas; /* números de vagas disponíveis para fechar a turma */
  17.     Aluno* alunos[4];
  18. };
  19.  
  20. typedef struct turma Turma;
  21. Turma* turmas[4];
  22.  
  23. Turma* cria_turma(char id){
  24.  
  25.     printf("Turma criada com sucesso!\n");
  26.  
  27. }
  28. void matricula_aluno(Turma* turma, int mat, char* nome){
  29.  
  30.  
  31.  }
  32.  
  33. int main(){
  34.     int n;
  35.     Turma *turma;
  36.     turma = (Turma *) malloc(3*sizeof(Turma));
  37.  
  38.     printf("Bem-vindo ao Programa de Gerenciamento de Turmas!\nEste programa gerencia as turmas ofertadas, fornecendo as\nfuncionalidades de matricula, lancamento de notas e listagem de alunos.\n");
  39.     printf("Auto: Romulo Sobreira versão: 1.0");
  40.  
  41.     do{
  42.         printf("\n\nMENU: \n");
  43.         printf("1 - Criar turma\n2 - Listar turmas\n");
  44.         printf("3 - Matricular Aluno\n4 - Lancar notas\n");
  45.         printf("5 - Listar alunos\n6 - Sair\n");
  46.         printf("Digite sua opcao: ");
  47.         scanf("%d", &n);
  48.  
  49.         switch(n){
  50.             case 1:
  51.                 printf("Criando nova turma...\n");
  52.                 printf("Digite um id: ");
  53.                 scanf(" %c", turma->id);
  54.                 cria_turma(turma->id);
  55.                 break;
  56. //            case 2:
  57.  
  58.  
  59.         }
  60.  
  61.     }while(n != 0);
  62.  
  63.     return 0;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement