Last active
January 26, 2021 16:59
-
-
Save gallib/c2669ff2ef1d6c477140b74198340b55 to your computer and use it in GitHub Desktop.
Débuter avec Dart, exercice 5
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
void main() { | |
transport(6); | |
transport(18); | |
transport(20); | |
transport(32); | |
transport(55); | |
transport(75); | |
} | |
void transport(age) { | |
if (age > 70) { | |
print('Je prends le bus'); | |
} else if (age > 50) { | |
print('Je conduis ma bécane'); | |
} else if (age > 30) { | |
print('Je conduis un monospace'); | |
} else if (age > 18) { | |
print('Je conduis une voiture d\'occasion'); | |
} else if (age == 18) { | |
print('Je passe le permis'); | |
} else { | |
print('Je me fais transporter'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment