Question: There are five parts for an email address which include the username, an @ symbol, domain name, a dot, and the domain. username Write

There are five parts for an email address which include the username, an @ symbol, domain name, a dot, and the domain. username Write a program that asks the user to enter an email. Your program should check the following rules: Possible input ab@gmail.com The username should consist of 3 characters at least and does not exceed 20 characters. The username can include two dots at maximum. The length of the domain name should be less than 7 characters. The domain should be two characters or more. ab.cd.ed.fg@gmail.com mycat@abcdefg.com mycat@gmail.c name@gmail.com The entered email should include only and only one @ symbol. The entered email should NOT include the '#' symbol. mycat@yes@gmail.com mycat.gmail.com my#cat@gmail.com mycat@gmail.com my.little.cat@gmail.com mycat@gmail.jo domain name the domain Test Cases The output of your program should be like this: Invalid: The username should consist of 3 characters at least. Invalid: The username can include two dots at maximum. Invalid: The length of the domain name should be less than 7 characters Invalid: The domain should be two characters or more. Valid email. Valid email. Invalid: The entered email should include only and only one @ symbol. Invalid: The entered email should include only and only one @ symbol. Invalid: The entered email should NOT include the '#' symbol. Valid email.
Step by Step Solution
3.47 Rating (173 Votes )
There are 3 Steps involved in it
Following are the solution in java import javautilScanner public class EmailValidation public static void mainString args Scanner scanner new ScannerS... View full answer
Get step-by-step solutions from verified subject matter experts
