The Warrior Way, Responsibility

Debug this program, and then create your own version that randomly decides if you've followed school guidelines.

Add comments and nested conditionals to allow for 4 possibilities

class Main {

  public static void main(String[] args){
    double chance = Math.random();
    System.out.println(chance); 
    if(chance<0.5)// didn't follow respect rule
      if(chance<0.5) { 
        System.out.println("bad news, you were impatient in line");
        System.out.println("bad news, left your trash lying around");
      }
      else {
        System.out.println("bad news, you were impatient in line");
        System.out.println("Thanks for putting your trash away");
      }
    else  
      if(chance<0.5) {
        System.out.println("Thanks for being patient in line");
        System.out.println("bad news, left your trash lying around");
      }
      else { 
       System.out.println("Thanks for being patient in line");
        System.out.println("Thanks for putting your trash away");
      }
  }
}

completed code will be logically correct and have comments like this:

code 2