Advertisement
joxaren

MarkIfTest2

Mar 30th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. public class MarkIfTest {
  2.  
  3.     void checkIfMarkGetsValueOf5() {
  4.         int x = 15;
  5.         while (x > 0) {
  6.             int mark = (int) (Math.random() * (6 - 2) + 2);
  7.             x = x - 1;
  8.             if (mark == 5) {
  9.                 System.out.println("Ayep, it works.");
  10.             } else {
  11.                 System.out.println("Nah, it doesn't work.");
  12.             }
  13.         }
  14.     }
  15.     public static void main(String[] args) {
  16.         MarkIfTest mark1 = new MarkIfTest();
  17.         mark1.checkIfMarkGetsValueOf5();
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement