Created
June 9, 2021 18:28
-
-
Save giuseppe998e/1c65864836b294cd567fc8c0bff58c21 to your computer and use it in GitHub Desktop.
Script per calcolare il voto di partenza per la laurea triennale presso il Dip.Inf. @ UniTo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Calcolatore della media di laurea triennale | |
# presso l'università degli studi di Torino | |
# dipartimento di informatica | |
# | |
# Questo script segue la direttiva qui di seguito: | |
# http://laurea.educ.di.unito.it/packages/offerta_formativa/single_pages/accreditamento/consultazione/ScaricaDocumento.php?documento=846 | |
# | |
# Author: Giuseppe Eletto | |
# License: MIT | |
VOTE_LIST = [ | |
#(Voto, CFU, Lode?) | |
(18, 6), # Materia X | |
(25, 9), # Materia Y | |
(30, 12), # No lode | |
(30, 6, 0), # No lode | |
(30, 9, 1), # Si lode | |
# ... | |
] | |
# ------------------------------------------- | |
dividend = 0.0 | |
divisor = 0.0 | |
val_lodi = 0.0 | |
for (v, c, *l) in VOTE_LIST: | |
dividend += v * c | |
divisor += c | |
if l and l[0] > 0: | |
val_lodi += c * 0.02 | |
quotient = (dividend / divisor) * 3.83 | |
quotient = round(quotient, 2) | |
result = quotient + val_lodi | |
result = int(result + 0.5) # Arrotondamento | |
print(f"Media degli esami con voto: {quotient:6.2f}") | |
print(f"Incremento dato dalle lodi: {val_lodi:6.2f}") | |
print(f"Risultato media di partenza: {result:6.2f}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment