Skip to content

Instantly share code, notes, and snippets.

@muchirijane
Created September 17, 2019 08:12
Show Gist options
  • Save muchirijane/0cb525a62030cd7448a2bdc02a037fe3 to your computer and use it in GitHub Desktop.
Save muchirijane/0cb525a62030cd7448a2bdc02a037fe3 to your computer and use it in GitHub Desktop.
// If and Else statement in dart
// Symbols used:
// == is equal to
// ! is not equal to
// > is greater than
// < is less than
// >= is greater or equal to
// && AND
// || OR
// ! NOT
import 'dart:math';
void main() {
loveCalculator();
}
void loveCalculator(){
int loveScore = Random().nextInt(100) + 1;
print(loveScore);
if (loveScore > 75){
print('You love each other like Kanye loves Kanye');
}else if(loveScore >= 50 && loveScore < 75){
print('Watch out it might end before it begins.');
} else{
print ('Maybe you should find someone else.');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment