Dev - C++ - Proyecto gestion estudiantes

 
Vista:
sin imagen de perfil
Val: 2
Ha disminuido su posición en 5 puestos en Dev - C++ (en relación al último mes)
Gráfica de Dev - C++

Proyecto gestion estudiantes

Publicado por alveiro (2 intervenciones) el 13/07/2019 18:35:41
Buen dia, estoy haciendo un proyecto que lo que hace es permitir la administracion de notas, alumnos y profesores. Tenia estructurada una logica pero creo que no esta bien construida... alguien me podria ayudar?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
#include<iostream>
#include<stdlib.h>
#include<conio.h>
#include<string.h>
#include<fstream>
#include "stdio.h"
 
using namespace std;
 
int menuInicio();
void Administrador();
void Estudiante();
void Maestro();
void titulo();
void mostrarNotas(int numero);
void mostrarMaterias(int numero);
void insertarUsuarioTXT();
void crearMaestro();
void crearEstudiante();
int tituloIngresoNotas(int numeroProfesor);
int menuMaestro(int numeroMaestro);
void ingresarNotasMateria1(int numeroProfesor, int numeroEstudiante);
void ingresarNotasMateria2(int numeroProfesor, int numeroEstudiante);
void ingresarNotasMateria3(int numeroProfesor, int numeroEstudiante);
 
int canEst=0;
int canProf=0;
int const cantidadMateriasMaestro;
int cantidadNotas=3;
int cantidadMaterias=0;
 
struct nota{
	int nota[3];
};
 
struct estudiante{
	int usuario;
	char pass[20];
	char nombre[20];
	int edad;
	char correo[40];
 
	nota Notas;
 
}estu[100];
 
struct materia{
 
	char nombreMateria[40];
	int grupoMateria;
	estudiante Estudiantes;
 
 
};
 
struct maestro{
 
	int usuario;
	char pass[20];
	char nombre[20];
	int edad;
	char correo[40];
 
	materia Materias[cantidadMateriasMaestro];
}profe[100];
 
maestro Maestros[20];
 
 
 
main (){
 
 
	int opc;
	system("cls");
	system ("color 70" );
	setlocale(LC_ALL, "");
 
	titulo();
 
	cout<<"                               1. Administrador"<<endl;
	cout<<"                               2. Estudiante"<<endl;
	cout<<"                               3. Maestro"<<endl;
	cout<<"                               4. Salir"<<endl;
	cout<<"                               Opcion:  ";
	cin>>opc;
	cin.ignore();
 
	do{
		switch(opc){
			case 1: system("cls");
					Administrador();
					break;
			case 2:	system("cls");
 
					break;
			case 3:	system("cls");
 
					break;
			case 4: exit(1);
 
			default: cout<<"Ingrese un valor valido";
		}
		system("pause");
	}while(opc!=4);
 
}
 
void Administrador() {
 
	int usuario;
	int pass;
	int opc;
 
	int UsuarioProfe;
	char ContProfe[20];
 
	int UsuarioEst;
	char ContEst[20];
 
	system("cls");
	titulo();
	cout<<"                              MENU ACCESO ADMINISTRADOR"<<endl<<endl;
	cout<<"                                   USUARIO:";
	cin>>usuario;
	cin.ignore();
	cout<<"                                   CONTRASENA:";
	cin>>pass;
	cin.ignore();
 
	if (usuario==12345 & pass==12345){
 
		system("cls");
		titulo();
		cout<<"                              MENU ADMINISTRADOR"<<endl<<endl;
		cout<<"                             1. AGREGAR MAESTRO"<<endl;
		cout<<"                             2. AGREGAR ESTUDIANTE"<<endl;
		cout<<"                             3. MOSTRAR MAESTROS"<<endl;
		cout<<"                             4. MOSTRAR ESTUDIANTES"<<endl;
		cout<<"                             5. SALIR"<<endl;
		cout<<"                             Opcion:";
		cin>>opc;
		cin.ignore();
 
 
		do {
			switch(opc){
				case 1:crearMaestro();
                    break;
 
				case 2:	crearEstudiante();
                    break;
 
				case 3:
                    break;
 
				case 4:
                    break;
 
				case 5: main();
 
			}
 
		}while(opc!=5);
 
	}
 
}
 
void crearMaestro(){
 
	int cantidadMateriasaImponer;
	int UsuarioProfe;
	char ContProfe[20];
 
    system("cls");
    titulo();
    cout<<"\n\n\n                INGRESO DE MAESTRO"<<endl<<endl;
    cout<<"\n\n\n              Ingrese el usuario : ";
    cin>>UsuarioProfe;
    cin.ignore();
    cout<<"\n\n\n              Ingrese la contraseña :";
    cin>>ContProfe;
    cin.ignore();
 
    for (int i=0;i<=canProf;i++){
 
        if (UsuarioProfe!=profe[i].usuario)
    {
 
    profe[canProf].usuario=profe[canProf].usuario+UsuarioProfe;
    strcpy (profe[canProf].pass,ContProfe);
 
    canProf=canProf+1;
 
    system("cls");
    titulo();
    cout<<"\n\n\n                INGRESO DE MAESTRO"<<endl<<endl;
    cout<<"\n\n\n              Ingrese el nombre del maestro:";
    cin>>profe[canProf].nombre;
    cin.ignore();
    cout<<"\n\n\n              Ingrese la edad del maestro:";
    cin>>profe[canProf].edad;
    cin.ignore();
    cout<<"\n\n\n              Ingrese el correo del maestro:";
    cin>>profe[canProf].correo;
    cin.ignore();
 
    cout<<"Cuantas materias dictara el profesor?";
    cin>>cantidadMateriasaImponer;
 
    cantidadMateriasMaestro==cantidadMateriasMaestro+cantidadMateriasaImponer;
 
    system("cls");
    titulo();
    cout<<"\n\n\n                INGRESO DE MAESTRO"<<endl<<endl;
 
    for (int i=0;i<cantidadMateriasaImponer;i++){
    cout<<"\n\n\n              Ingrese la materia "<<i+1<<" que dicta el maestro:";
    cin>>profe[canProf].Materias[i].nombreMateria;
    cout<<"\n\n\n              Ingrese el numero del grupo de la materia";
    cin>>profe[canProf].Materias[i].grupoMateria;
    cin.ignore();
 
    cantidadMaterias=cantidadMaterias+1;
 
    }
 
    cantidadMateriasMaestro=0;
    main();
    }
    else
    {
    cout<<"Usuario ya existente";
        system("pause");
        return;
    }
    }
 
}
 
 
 
void crearEstudiante() {
 
    int numeroMateriasEstudiante;
    int UsuarioEst;
    char ContEst[20];
 
    system("cls");
    titulo();
    cout<<"\n\n\n                INGRESO DE ESTUDIANTE"<<endl<<endl;
    cout<<"\n\n\n              Ingrese el usuario : ";
    cin>>UsuarioEst;
    cout<<"\n\n\n              Ingrese la contraseña :";
    cin>>ContEst;
 
    for (int i=0;i<=canEst;i++){
 
        if (UsuarioEst!=estu[i].usuario){
 
            estu[canEst].usuario=estu[canEst].usuario+UsuarioEst;
            strcpy (estu[canEst].pass,ContEst);
 
            canEst=canEst+1;
 
            system("cls");
    titulo();
    cout<<"\n\n\n                INGRESO DE ESTUDIANTE"<<endl<<endl;
    cout<<"\n\n\n                Ingrese el nombre del estudiante :";
    cin>>estu[canEst].nombre;
    cin.ignore();
    cout<<"\n\n\n                Ingrese la edad del estudiante   :";
    cin>>estu[canEst].edad;
    cin.ignore();
    cout<<"\n\n\n                Ingrese el correo del estudiante :";
    cin>>estu[canEst].correo;
    cin.ignore();
 
    system("cls");
    cout<<" Existen "<<cantidadMaterias<<" materias "<<endl;
 
    for (int i=0;i<=canProf;i++){
        for (int j=0;j<cantidadMaterias;j++){
 
            cout<<i+1<<" )   "<<profe[i].Materias[j].nombreMateria<< " con el grupo :"<<profe[i].Materias[j].grupoMateria<<" impartida por :"<<profe[i].nombre<<endl;
        }
    }
 
 
    cout<<" Digite el numero de materias que el estudiante vera ";
    cin>>numeroMateriasEstudiante;
 
    cout<<" Seleccione el numero de la materia que se le asignara al estudiante";
 
    for (int i=0;i<=numeroMateriasEstudiante;i++){
 
        int seleccion;
 
        cin>>seleccion;
 
    }
 
        }
        else
        {
            titulo();
            cout<<"\n\n\n                INGRESO DE ESTUDIANTE"<<endl<<endl;
            cout<<"Estudiante ya creado ";
            system("pause");
            return;
        }
 
    }
 
 
}
 
void titulo(){
 
	cout<<"\t---------------------------------------------------------------"<<endl;
	cout<<"\t\t\t Universidad Francisco Jose de Caldas"<<endl;
	cout<<"\t\t\t\t GESTION ACADEMICA"<<endl;
	cout<<"\t---------------------------------------------------------------"<<endl<<endl;
 
}

Este es como el tercer programa que hago, lo que pasa esque tiene que ser dinamico
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder