The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Need help finishing a method with logic that I'm not understanding.
Say I have the following method with a Message class that logs "THE_DOOR_IS_UNLOCKED" to an ArrayList:
Â
public void selectUnlockSwitch()
   {
       if (carDoorLocked == false)
       {
           myLog.add(Message.THE_DOOR_IS_UNLOCKED);
       }
Â
How can I create logic that will determine if THE_DOOR_IS_UNLOCKED_ALREADY?
Â
I basically want to do like the following, which I know doesn't work, but for illustration:
Â
if (carDoorLocked == false) && carDoorLocked == false)
{
     myLog.add(Message.THE_DOOR_IS_UNLOCKED_ALREADY)
}
Â
Each time a user selects the option to unlock a door that is already unlocked, the message "THE DOOR IS UNLOCKED ALREADY"Â should be recorded.
-----------