Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- struct aluno{
- int mat;
- char nome[81];
- float notas[3];
- float media;
- };
- typedef struct aluno Aluno;
- struct turma{
- char id; /* caractere que identifica a turma, por exemplo, A ou B */
- int vagas; /* números de vagas disponíveis para fechar a turma */
- Aluno* alunos[4];
- };
- typedef struct turma Turma;
- Turma* turmas[4];
- Turma* cria_turma(char id){
- printf("Turma criada com sucesso!\n");
- }
- void matricula_aluno(Turma* turma, int mat, char* nome){
- }
- int main(){
- int n;
- Turma *turma;
- turma = (Turma *) malloc(3*sizeof(Turma));
- 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");
- printf("Auto: Romulo Sobreira versão: 1.0");
- do{
- printf("\n\nMENU: \n");
- printf("1 - Criar turma\n2 - Listar turmas\n");
- printf("3 - Matricular Aluno\n4 - Lancar notas\n");
- printf("5 - Listar alunos\n6 - Sair\n");
- printf("Digite sua opcao: ");
- scanf("%d", &n);
- switch(n){
- case 1:
- printf("Criando nova turma...\n");
- printf("Digite um id: ");
- scanf(" %c", turma->id);
- cria_turma(turma->id);
- break;
- // case 2:
- }
- }while(n != 0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement