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.
-
Theory of constraints, contribution margin , sensitivity analysis. Fun Time Toys (FTT) produces dolls in two processes: molding and assembly. FTT is currently producing two models: Chatty Chelsey and...
-
As _______ a dancer as she was, at least in the opinion of the general public, her failure to have trained at the illustrious Kirov School of Ballet precluded her from achieving the coveted title of...
-
Abbott, Inc., plans to issue \(\$ 500,000\) of ten percent bonds that will pay interest semiannually and mature in five years. Assume that the effective interest rate is 12 percent per year...
-
a. Construct a personal income statement for the Humperdinck family using the following information: salaries, $42,000; mortgage payment, $7,980; food, $2,400; interest income, $150; transportation,...
-
his question: 2 point(s) possible Submit test The data set below on the left represents the annual rate of return (in percent) of eight randomly sampled bond mutual funds, and the data set below on...
-
List the stages of the Procure to Pay Process and explain what is entailed in each step. Indicate what stage the following would take place. Invoice, RFQ, Statement of Work, a blanket purchase order,...
-
The following information was obtained from matched samples. The daily production rates for a random sample of workers before and after a training program are shown below. Worker 1 2 3 4 5 6 7 Before...
-
1. Let random variables X and Y each have range (1,2,3,4). The following formula gives their joint probabilities P(X = i, Y =j) = (i+j)/80 Compute each of the following: (a) Find the joint and...
-
Corporate valuation serves as a cornerstone for decision-making, strategic planning, and investment; however, its accuracy and effectiveness often rely on the backdrop of good corporate governance....
-
Sanford Sons Ltd. produces two confectionery products: candy apples and cotton candy. In 2019, the Company sold $100,000 worth of candy apples that generated a 48% contribution margin and $80,000...
-
The tengent plane at the indicated point (x0, y0, z0) exist. Find its equation. f(x, y) = xe;(1,0,1)
-
The x values - percentage of the population with at least four years of higher education. The y values= percentage of growth in per capita income. X y 9.9 37.1 11.4 43.0 8.1 14.7 33.4 47.1 The sample...
-
In the figure below there are two equal couples with a magnitude of M 15 kNm and they act in opposite directions while being applied to the channel beam AB. These couples cause the beam to bend in...
-
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....
-
Partner A contracted with a vendor to buy a computer for the partnership. Partner A did not discuss the transac- tion with Partner B or get Partner B's approval. Partner B refused to approve payment...
-
Sherwin Corporation invest its excess cash in equity securities when such founds are not needed to support operations. At the beginning of the year the companys portfolio consisted of the following...
-
Amy Cardoza, Jeff Williams, and Claire Mangoni are partners in an existing music business. Each partner's equity is \($32,000,\) for a total equity of \($96,000.\) The partners agree to admit Russ...
Study smarter with the SolutionInn App