There are five parts for an email address which include the username, an @ symbol, domain...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Answer rating: 100% (QA)
Following are the solution in java import javautilScanner public class EmailValidation public static void mainString args Scanner scanner new ScannerS... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Write a program that asks the user to enter the name of his or her favorite city. Use a String variable to store the input. The program should display the following: The number of characters in the...
-
Write a program that asks the user to enter three test scores. The program should display each test score, as well as the average of the scores.
-
Write a program that asks the user to enter the name of a file, and then asks the user to enter a character. The program should count and display the number of times that the specified character...
-
Outline suggestions to make observation a useful, reliable requirements elicitation technique.
-
What is productivity, and why does it matter?
-
An investment strategy's return is normally distributed and has a mean of 95 and a standard deviation of 12 . if returns are normally distributed, find the probability of a randomly selected...
-
Discuss corporate tactics that can be used in a down economy to keep top talent.
-
Arthur Company is considering investing in an annuity contract that will return $46,000 annually at the end of each year for 15 years. What amount should Arthur Company pay for this investment if it...
-
Consider the function f(x1,x2) = x 5x1x2 + 6x at the point x = (0, 2) and search direction p = (1, 1). 1. Write down the first-order Taylor approximation to f(x + ap), where a is the step size. 2....
-
Leisure City maintains a Pension Trust Fund for its employees. Following is a trial balance for the fund at December 31, 2011: The following transactions took place during 2012: 1. Both Leisure City...
-
Internal rate of return method for a service company Vail Resorts, Inc. (MTN), announced a $452,000 million expansion of lodging properties, ski lifts, and terrain in Park City, Utah. Assume that...
-
these two seem like two questions but it's just one big question. Guidance Corp is preparing its Master Budget for 20XX. You need to prepare Guidance's Direct Materials Budget and Schedule of Cash...
-
Suppose you are advised to use the following risk metric V, which one may name Median Shortfall: P(R -V|R
-
(Oct 1) Lopez invested $75,000 cash, a $25,000 computer system, and $10,000 of office equipment in the business in exchange for its common stock (Oct 2) Paid $3,500 cash for four months rent (Oct 3)...
-
Complete the table given below Bridgeport Bridgeport started his own consulting firm, Bridgeport Consulting, on June 1, 2022. The trial balance at June 30 is as follows. Cash BRIDGEPORT...
-
Prepare an Excel spreadsheet with a budget for Cupcakes-Palooza Inc. for 2023 using the assumptions below. Your assignment will be to produce a spreadsheet with the sales, expenses, and net income...
-
If an inheritance is compounded annually at 11% and reaches a total of $100,000 after 21 years, what would the starting amount of the investment be?
-
Splitting hairs, if you shine a beam of colored light to a friend above in a high tower, will the color of light your friend receives be the same color you send? Explain.
-
How much of each of the following prizes or awards is taxable? a. Cheline received a $50,000 gift bag at the Oscars in 2012. b. Jon received a gold watch worth $350 for 25 years of service to his...
-
Indicate whether each of the items listed below would be included (I) in or excluded (E) from gross income for the 2012 tax year. ________a. Welfare payments ________b. Commissions ________c. Hobby...
-
Greg died on July 1, 2012, and left Lea, his wife, a $50,000 life insurance policy which she elects to receive at $5,000 per year plus interest for 10 years. In the current year, Lea receives $6,200....
-
Using a financial calculator, solve for the unknowns in each of the following situations. a. On June 1, 2024, Holly Golightly purchases lakefront property from her neighbor, George Peppard, and...
-
Ed owns Oak Knoll Apartments. During the year, Fred, a tenant, moved to another state. Fred paid Ed \($1,000\) to cancel the two-year lease he had signed. Ed subsequently began renting the unit to...
-
In 2017, Harry and Mary purchased Series EE bonds, and in 2023 redeemed the bonds, receiving \($500\) of interest and \($1,500\) of principal. Their income from other sources totaled \($30,000.\)...
Study smarter with the SolutionInn App