Skip to content

Instantly share code, notes, and snippets.

@gallib
Last active January 26, 2021 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gallib/c2669ff2ef1d6c477140b74198340b55 to your computer and use it in GitHub Desktop.
Save gallib/c2669ff2ef1d6c477140b74198340b55 to your computer and use it in GitHub Desktop.
Débuter avec Dart, exercice 5
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