Created
December 1, 2016 10:34
-
-
Save paolorotolo/f5ad2d04f34c80a63874bfeb164ab7e9 to your computer and use it in GitHub Desktop.
This file contains 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
numeroSoci = input('Quanto soci vuoi inserire?') | |
for i=1:numeroSoci | |
socio(i).nome= input('nome: ', 's') | |
socio(i).cognome=input('cognome: ', 's') | |
socio(i).cf=input('cf: ', 's') | |
socio(i).qs=input('qs: ', 's') | |
socio(i).ruolo=input('ruolo (AMM 1 - CONS 2 - SOCIO 3): ') | |
end | |
caricheSpeciali = 0; | |
for i=1:numeroSoci | |
if socio(i).ruolo == 3 | |
else | |
caricheSpeciali=caricheSpeciali+1 | |
end | |
end | |
disp(percentuale(caricheSpeciali, numeroSoci)) | |
function a = percentuale(cariche, soci) | |
a = (cariche*100)/soci | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment