Write a program named EmailValidation that prompts the user for an email address and displays whether...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. <username>@<server name>. (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 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. <username>@<server name>. (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
Expert Answer:
Answer rating: 100% (QA)
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 the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
A flat and infinitely large sheet with uniform charge density moves with constant speed in a direction parallel to its surface. Confirm the differential form of Poyntings theorem at every point not...
-
The records of Sudbury Menswear report the following data for the month of September: Instructions (a) Estimate the ending inventory using the conventional retail inventory method. (b) Assuming that...
-
Calculate the number of Frenkel defects per cubic meter in zinc oxide at 1000C. The energy for defect formation is 2.51 eV, while the density for ZnO is 5.55 g/cm 3 at (1000C).
-
Explain the structure and working of four-stroke petrol engine with a neat sketch.
-
Southwest Airlines, Inc., has total operating revenues of $6.53 million on total assets of $11.337 million. Their property, plant, and equipment, including their ground equipment and other assets,...
-
A sphere of 10 N is hanged as shown in figure. Find tension in the rope and reaction of wall. Wall- T R- 10 N String Sphere 60 120 R 90 10 N Free body diagram
-
research all about the following: 1) LINUX SYSTEM 2) LINUX COMPONENTS 3) LINUX DISTRIBUTIONS
-
On May 1, 2020, AWM Ltd. issued a series of bonds in order to raise money for some upcoming projects. The bonds had a face value of $5,426,000 and matured in 10 years. Interest was payable at a face...
-
3. On January 1, an investment fund was opened with an initial balance of 5000. Just after the balance grew to 5200 on July 1, an additional 2600 was deposited. The annual effective yield rate for...
-
Your client organization ( organization must be on the ARC campus: ASB,Links to an external site. SportsLinks to an external site. , Support ServicesLinks to an external site. ) has asked you to...
-
The term structures of discount factors prevailing Canada and the United Kingdom on September 11, 2023, are presented in the following table. On this date, the spot exchange rate is equal to GBP 1...
-
How many electrons at a time are passed between the pigmen molecules in the light-harvesting complexes? O 0 0 1 O 2 O 3 O 4
-
MTN Ghana Ltd. acquired a brand new property (land and buildings) on 1st January, 2016 for GH40 million (including GH15 million in respect of the land). The asset was revalued on the 31st of...
-
For each of the following transactions, indicate whether it increases, decreases, or has no effect on the following financial ratios: current ratio, debt-to-equity ratio, profit margin ratio, and...
-
For an alternative to the String class, and so that you can change a Strings contents, you can use ____________. a. char b. StringHolder c. StringBuilder d. StringMerger
-
Write, compile, and test a class that uses the command window to display the following statement about comments: Program comments are nonexecuting statements you add to a file for documentation.Also...
-
Suppose that a class named Bicycle contains a private nonstatic integer named height, a public nonstatic String named model, and a public static integer named wheels. Which of the following are legal...
-
Assume the following information about Johnson & Johnson (ticker: JNJ). JNJs equity beta is 0.60. The yield on 10-year treasuries is 3%, and you estimate the market risk premium to be 6%....
-
You are working for Microsoft evaluating the possibility of selling energy drinks. Microsofts WACC is 8.1%. Energy drinks would be a new line of business for Microsoft, however, so the systematic...
-
By using the yield to maturity on AT&Ts debt, we found that its pretax cost of debt is 3.65%. If AT&Ts tax rate is 25%, what is its effective cost of debt?
Study smarter with the SolutionInn App