I'm working on a college assessment, and I need to update my program. I need to add code that will ask for what the amount of scores is, and display a prompt for each score, based on what that number was.
So something like...
scoreAmount = prompt("How many scores did you get?");
If the user inputs "3", then I want the user to be asked for the 3 scores. So, "What was your 1st score?", "What was your 2nd score?", and ""What was your 3rd score?".
I was thinking of using an array somehow, but I don't know how.
I tried looking around for a similar question already asked, or using what I already know about arrays, but I'm still clueless.
If I was to use arrays, I would probably need to turn the input number into an empty array, so if the user put in "3", it would create an array "[ , , ]" or "[0, 0, 0]". And then call the array values one by one for each prompt.
So if the array was called "scoreArray", each prompt would call a value of that array from left to right, until all values have been called for. Again, I've looked around on how to do this, but I still have no idea.
What I have tried:
I have not tried anything yet.