...

Exercise: Driver's License Eligibility

Now let's practice using the && operator in a real-world scenario! To get a driver's license, you need to meet two requirements:

  • At least 16 years old: age >= 16
  • Completed driver's education: hasDriversEd === "yes"

Both conditions must be true - if either one is false, you cannot get your license.

Your Task

Write a program that checks if a person is eligible for a driver's license:

  • If they meet both requirements, print: "You are eligible for a driver's license!"
  • If they do not meet both requirements, print: "You are not eligible for a driver's license."
Loading...

Output (Console)