Question: Write a program named EmailValidation that prompts the user for an email address and displays whether or not it's valid. Assume the following rules:



Write a program named EmailValidation that prompts the user for an email address and displays whether or not it's valid. Assume the following rules: - Only letters, numbers, dots (.), underscores () and dashes (-) are allowed - The email must contain an @ and. which separates the email address in 3 sections (username, email server, top-level domain i.e. @ . (top-level domain) There is at least one character in each of the 3 sections Your solution must include at least one method. Continue accepting email addresses until the user enters "n". Sample output 1: Enter an email address: harry potter@hogwarts.edu Valid email address Enter another? y/n y Enter an email address: hermione #237@hogwarts.edu Invalid: only letters, numbers, Enter another? y/n allowed y Enter an email address: hagrid@hogwarts Invalid email format. Enter another? y/n Y Goodbye! Concepts that have not been covered in class cannot be used, for example, arrays, BufferedReader, String methods that have not been introduced, the use of break (except in switch statements), regular expressions, System.exit(), arrays, a return in the main method, etc. Do not code loops with forms like while(true). Check with your instructor or TA if you have concerns. Use meaningful names for variables; you must follow the camelCase naming standard. Make sure to include a multi-line comment at the top of your code with your name and student number. Format your code so it is easy to read and use comments to provide extra information and detail about your code. Ensure you have followed standard indentation practices - consider using the Auto-layout feature in BlueJ. Avoid excessive use of blank lines. Your code must scale to work for any valid input. LO: Intros and Admin L01: Java Intro [video] LO2: Literals, Variables, and Data Types [Ex02] L03: Expressions and Scanner [Ex03] L04: String Class and JOptionPane [Ex04] L05: Control Structures: If [Ex05] L06: Control Structures: While [Ex06] L07: Control Structures: For [Ex07] Nested Loops [video] Test 1 [sample] L08: Control Structures: Do while and Switch [Ex08] L09: Intro to Methods [Ex09] L10: Java Class Libraries: Random [Ex10], L11: Character [Ex11] [video] 19-Feb to 26-Feb READING WEEK - NO CLASS L12: Java Class Libraries: Math, Integer
Step by Step Solution
3.37 Rating (153 Votes )
There are 3 Steps involved in it
Below is a simple Java program that adheres to the provided requirements Please note that it does not use concepts that have not been covered in class ... View full answer
Get step-by-step solutions from verified subject matter experts
