Storing student information [closed]

0

I need to develop a program on WINDOWS platform where student information will be stored: age , < strong , shuffle and name tags. The program should also contain a name search. I would like suggestions.

    
asked by anonymous 15.05.2015 / 01:34

1 answer

1

You may be creating a structure vector .

#define MAX_ALUNOS 50

struct Alunos
{
    std::string Nome;
    unsigned int idade;

    std::string turma;
    std::string turno;
};

std::vector<Alunos> Hypnos_Alunos(MAX_ALUNOS);

And in the search, you might be creating a function that gets a string with the student's name.

void Buscar_Por_Aluno(std::string NOME)
{
    for (int x = 0; x < MAX_ALUNOS; x++)
    {       
        if (Hypnos_Alunos[x].Nome.compare(NOME) == 0)
        {
            // Listando dados do aluno encontrado
            std::cout << "Nome: " << Hypnos_Alunos[x].Nome << std::endl;
            std::cout << "Idade: " << Hypnos_Alunos[x].idade << std::endl;
            std::cout << "Turma: " << Hypnos_Alunos[x].turma << std::endl;
            std::cout << "Turno: " << Hypnos_Alunos[x].turno << std::endl;
        }
    }
}
    
15.05.2015 / 01:40