Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # *******************************************
- # Introducción a la programación
- # Segundo Parcial Práctico - Ejercicio 3
- # Fecha: 5/11/19
- # Autor: Lic. Diego Krauthamer
- # Descripción: Sistema de gestión académico
- # *******************************************
- #Declaración de constantes
- #Declaración de variables
- opcion=-1
- continuar="S"
- nombre=""
- carrera=""
- nota=0
- canttur=0
- cantpef=0
- cantci=0
- sumatur=0
- sumapef=0
- sumaci=0
- #Cuerpo principal del programa
- while opcion !=3:
- #Inicializacion de variables
- opcion=-1
- continuar="S"
- #Dibujo el menu principal de opciones
- print("M E N U P R I N C I P A L")
- print("1. Alta de alumnos")
- print("2. Reportes")
- print("3. Salir")
- #Ingreso de datos y validacion
- while opcion <1 or opcion >3:
- print("Seleccione una opción:")
- opcion=int(input())
- #Mensaje de errores
- if opcion <1 or opcion >3:
- print("ERROR- Por favor seleccione una opción valida(1-3):")
- #Determino la oprecion elegida
- if opcion==1:
- while(continuar=="S"):
- #Inicializacion de variables
- nombre=""
- carrera=""
- nota=-1
- continuar=""
- # ***************************************
- # I N G R E S O D E D A T O S
- # ***************************************
- #Ingreso y validacion del nombres
- while nombre =="":
- print("Ingrese el nombre:")
- nombre=input()
- #Mensaje de error
- if nombre =="":
- print("ERROR - Ingrese un nombre")
- #Ingreso y validacion de la carrera
- while carrera =="" and carrera!="t" and carrera !="p" and carrera!="c":
- print("Ingrese carrera:")
- print("T-Turismo")
- print("P-PEF")
- print("C-Construcciones inteligentes")
- carrera=input()
- #Mensaje de error
- if carrera =="" and carrera!="t" and carrera !="p" and carrera!="c":
- print("ERROR - Ingrese una carrera válida")
- #Ingreso de notas
- while nota <1 or nota >10:
- print("Ingrese nota final de cursada:")
- nota=int(input())
- #Mensaje de error
- if nota <1 or nota >10:
- print("ERROR - Ingrese una nota entre 1 y 10")
- # ******************************************
- # E S T A D I S T I C A S
- # ******************************************
- # Determino la carrera del alumno para contar
- # y calcular la sumatoria por carrera
- #
- # ******************************************
- if carrera=="t":
- canttur=canttur+1
- sumatur=sumatur+nota
- elif carrera=="p":
- cantpef=cantpef+1
- sumapef=sumapef+nota
- else:
- cantci=cantci+1
- sumaci=sumaci+nota
- #Pregunto si Desea continuar
- while continuar =="" and continuar!="s" and continuar !="n":
- print("Desea continuar S/N")
- continuar=input()
- #Mensaje de error
- if continuar =="" and continuar!="s" and continuar !="n":
- print("ERROR - Ingrese S/N")
- elif opcion==2:
- # *********************************
- # R E P O R T E S
- # *********************************
- print("Cantidad de alumnos de Turismo:",canttur)
- print("Cantidad de alumnos de PEF",cantpef)
- print("Cantidad de alumnos de Construcciones",cantci)
- print("Cantidad Total de alumnos:",canttur+cantpef+cantci)
- if canttur!=0:
- print("Promedio de Turismo",sumatur/canttur)
- if cantpef!=0:
- print("Promedio de PEF",sumapef/cantpef)
- if cantci!=0:
- print("Promedio de Construcciones",sumaci/cantci)
- print("")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement