How to create several Java codes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sunflowar
    New Member
    • Mar 2014
    • 2

    How to create several Java codes

    I am in beginning Java. I have been trying for several days to figure how to code the following:
    Use a while loop to ask for name, phone, and email separated by spaces using a single JOptionPane.
    In the loop, check if the user selects OK of Cancel without entering data, if so prompt the user until valid data is entered.
    Separate the name, phone, and email into separate String variables.
    In the loop, check if the name is 10 characters or less, if not, prompt the user until valid data is entered.
    If valid data is entered, create the Contact object using the constructor and name, phone, and email supplied by the user.
    Display the contents in a JOptionPane using the get methods.

    Even if someone can help me with just the "Use a while loop to ask for name, phone, and email separated by spaces using a single JOptionPane."

    and/or

    "If valid data is entered, create the Contact object using the constructor and name, phone, and email supplied by the user." code.

    I can figure out the rest I'm sure. And yes, I know how to spell Sunflower...the A was on purpose. Thank you to anyone who helps. I really appreciate it!
    Last edited by sunflowar; Mar 12 '14, 06:49 PM. Reason: Deleted certain steps
  • sunflowar
    New Member
    • Mar 2014
    • 2

    #2
    Thank you in advance to anyone that helps.
    Last edited by sunflowar; Mar 12 '14, 08:18 AM. Reason: put information with my post instead

    Comment

    Working...