SHARE
TWEET

Untitled




Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- import java.util.Random;
- class Main {
- int max = 100;
- int min = 1;
- public String WeirdMethod () {
- Random rand = new Random();
- int weirdgen = min + rand.nextInt(max);
- if ((weirdgen % 2) == 0) {
- if (weirdgen >= 2 && weirdgen <=5) {
- return "Not Weird";
- }else{
- return "Weird";
- }
- } if ((weirdgen % 2) == 0) {
- if(weirdgen >= 6 && weirdgen <= 20) {
- return "Weird";
- }else{
- return "Weird";
- }
- if ((weirdgen % 2) == 0) {
- if (weirdgen > 20) {
- return "Not Weird";
- }else{
- return "Weird";
- }
- }
- }
- }
- public static void main(String[] args) {
- Main result = new Main();
- System.out.println(result.WeirdMethod());
- }
- }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.