Created
August 24, 2018 18:56
-
-
Save Azure-Agst/33f2ff0af3a2d853515967b6291e3858 to your computer and use it in GitHub Desktop.
jesus i hate T1L9A2
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
import java.lang.*; | |
// "Write the code to print a random integer from -20 to 20 inclusive using Math.random()." | |
// | |
// fuck you for not letting me use Math.round() or Math.floor(). | |
// you'll just get a fucking if statement how about that? | |
// SUCK ME | |
public class Lesson_9_Activity_Two { | |
public static void main(String []args){ | |
double num = ((Math.random() - 0.5) * 2) *21; | |
if (num > 20){ | |
System.out.println(20); | |
} else if (num < -20) { | |
System.out.println(-20); | |
} else { | |
System.out.println((int)num); | |
} | |
} | |
} |
Does anyone really enjoy Java anyway?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm so tilted at this lesson