Javascript and arrays
-
struggling to figure out this program. beginner javascript programmer. My task is to write a program that does this: Stores the 50 states' names and capitals in two arrays (which I have). Uses the window.prompt() method to display a state name, asks the user to enter the matching capital name, and tells the user that entering "exit" will stop the program. Checks the user input and use the window.prompt() method to tell the user if the answer is correct or not. At the same time, the window.prompt() method displays the next state name, and asks the user to enter the next matching capital name. Please note that giving the user feedback and prompting the user to try the next are done with the same window.prompt(). Uses a loop to go through all 50 states until all 50 states have been displayed or the user enters "exit". Any guidance would be much appreciated. Even just getting pointed in the right direction. I've read through many tutorials and just can't seem to get it. Thank you.
-
struggling to figure out this program. beginner javascript programmer. My task is to write a program that does this: Stores the 50 states' names and capitals in two arrays (which I have). Uses the window.prompt() method to display a state name, asks the user to enter the matching capital name, and tells the user that entering "exit" will stop the program. Checks the user input and use the window.prompt() method to tell the user if the answer is correct or not. At the same time, the window.prompt() method displays the next state name, and asks the user to enter the next matching capital name. Please note that giving the user feedback and prompting the user to try the next are done with the same window.prompt(). Uses a loop to go through all 50 states until all 50 states have been displayed or the user enters "exit". Any guidance would be much appreciated. Even just getting pointed in the right direction. I've read through many tutorials and just can't seem to get it. Thank you.
Member 11116351 wrote:
My task
So start do it! Do not wait for us to do it for you! Thing are work a bit differently. YOU came with some (probably imperfect) solution and WE help you make it work...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
-
struggling to figure out this program. beginner javascript programmer. My task is to write a program that does this: Stores the 50 states' names and capitals in two arrays (which I have). Uses the window.prompt() method to display a state name, asks the user to enter the matching capital name, and tells the user that entering "exit" will stop the program. Checks the user input and use the window.prompt() method to tell the user if the answer is correct or not. At the same time, the window.prompt() method displays the next state name, and asks the user to enter the next matching capital name. Please note that giving the user feedback and prompting the user to try the next are done with the same window.prompt(). Uses a loop to go through all 50 states until all 50 states have been displayed or the user enters "exit". Any guidance would be much appreciated. Even just getting pointed in the right direction. I've read through many tutorials and just can't seem to get it. Thank you.
-
struggling to figure out this program. beginner javascript programmer. My task is to write a program that does this: Stores the 50 states' names and capitals in two arrays (which I have). Uses the window.prompt() method to display a state name, asks the user to enter the matching capital name, and tells the user that entering "exit" will stop the program. Checks the user input and use the window.prompt() method to tell the user if the answer is correct or not. At the same time, the window.prompt() method displays the next state name, and asks the user to enter the next matching capital name. Please note that giving the user feedback and prompting the user to try the next are done with the same window.prompt(). Uses a loop to go through all 50 states until all 50 states have been displayed or the user enters "exit". Any guidance would be much appreciated. Even just getting pointed in the right direction. I've read through many tutorials and just can't seem to get it. Thank you.
Please do not post same question multiple times