JavaScript : Boolean Expressions IV


  1. Correctly apply DeMorgan's theorem in the case of AND.

 Your Task, Your Challenge  

Le robot loueur de voiture

Write your code so that the robot lets you use the car when it is appropriate.

Use DeMorgan’s theorem to enable the robot to determine when it’s ok to let someone use the car based on the driver having their license and having obtained the key from the car rental agency.

There are 2 tests you can use to do this:

  1. keyOK() checks whether the driver has the car keys or not;
  2. licenseOK() checks whether the driver has his or her driver's license or not.

 Time to get to work :O) 

You must check every possible case to ensure that the robot correctly does or does not allow the car to be used.

Good luck!