I need help with the email address.

I need help finding the output of an email address program in java?

  • My teacher wants us to: Write a program that accepts a user's email address, then finds and outputs the username and address’ site type. (USING STRING ONLY) These are the acceptable site types - com, net, gov, org, mil, and edu. (Ex. Please enter your email address: [email protected] Your username is apple Your site type is commercial) If you have any questions about the directions, please let me know. Help would be greatly appreciated!! Thanks :)

  • Answer:

    Because email addresses use a strict format, you can parse the string for the last occurrence of a period and then store the remaining characters in a variable. Then, use that variable to look up the site type in some sort of selection set or case statement.

dukedogt... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.