Created
September 17, 2019 08:12
-
-
Save muchirijane/0cb525a62030cd7448a2bdc02a037fe3 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
// 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