Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fai-il-professore.js #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

davcattan
Copy link

aiuto! la console stampa tutti i giudizi, ma quando metto un valore inferiore a 18 stampa suff e non bocciato....perche???

aiuto! la console stampa tutti i giudizi, ma quando metto un valore inferiore a 18 stampa suff e non bocciato....perche???
@hillis1987
Copy link

aiuto! la console stampa tutti i giudizi, ma quando metto un valore inferiore a 18 stampa suff e non bocciato....perche???

Ciao! mettendo il default anziché il case 'g', ti stampa sempre la stessa cosa?

@soriceg
Copy link

soriceg commented Sep 24, 2020

aiuto! la console stampa tutti i giudizi, ma quando metto un valore inferiore a 18 stampa suff e non bocciato....perche???

Puoi ottenere il risultato in questi due modi:

if(voto>=18 && voto<21){voto='a'};
if(voto>=21 && voto<24){voto='b'};
if(voto>=24 && voto<27){voto='c'};
if(voto>=27 && voto<29){voto='d'};
if(voto>=30 && voto<31){voto='e'};
if(voto>=31){voto='f'};//valore alto
if(voto<=17){voto='g'};//bocciato

Oppure lasciare tutto come hai fatto e spostare if(voto<=17){voto='g'};//bocciato
in alto prima di tutte le altre condizioni if, cioè:

if(voto<=17){voto='g'};//bocciato
if(voto>=18, voto<21){voto='a'};
if(voto>=21, voto<24){voto='b'};
if(voto>=24, voto<27){voto='c'};
if(voto>=27, voto<29){voto='d'};
if(voto>=30, voto<31){voto='e'};
if(voto>=31){voto='f'};//valore alto

@davcattan
Copy link
Author

Ok grazie mille!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants