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!
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!
Comment