1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Java

Connected

Exercise

Email checking, but better

People were so pleased with your email checker that they want it improved to fit even more needs. You were made aware that not all email finish with 3 characters, and therefore try to fit that into the code. Also, you've been asked to add a message indicating when the @ symbol is missing.

Instructions

100 XP
  • Add a logical operator to check if there is a "."" anywhere after the "@".
  • Use the right control flow to catch all bad emails - you want to flag emails that have "@" at the right or don't contain "." after "@".
  • Make sure, using the right logical operator, that we get a message for emails not containing @.