|
The WHILE statement makes this an infinite loop.
Some points.
The if(name==null ||name=="" || country==null......... will make this go back to entering info and the person entering info will not know why.
You made the variables GLOBAL, you don't need to pass them into the functions.
promptInformation(); will call the function and function promptInformation() and function validation() are good to go because they know the variables already.
And also without looking at the code I wouldn't have known I needed to input us or US to get this to show blue.
I suggest you evaluate each input as soon as it's entered if it's wrong or non existent tell the user why and ask for the input again. Then go into the red/blue printing.
|