Hi guys, college student here having some trouble with the JavaScript portion of my computer science class. I'm almost done with this week's assignment, but this one problem is giving me fits. It asks me to wite a script that uses repetition and a switch structure to print the song 'The Twelve Days of Christmas.' I somewhat understand what it is trying to get me to do... something along the lines of, case "1": A partridge in a pear tree. case "2": case "1" + two turtle doves... And I also know that I should probably make a variable for each "day".. I just can't wrap my head around the problem as a whole. Please help me. I'm not some lazy student on here begging yall to do my homework, I just can't get help from my professor since the class is being taken in and online format and can't afford a tutor! I've worked hard on this and hate to hit this wall. Thanks in advance guys...
Create a FOR loop that counts from 1 to 12, or a DO..WHILE loop that increments a variable from 1 to 12. Inside that loop, use another loop that counts down from the current day, and a switch statement to print the lines for that day. That is one way to do it, there are plenty of other ways. I'm surprised that you were given this question, it's all over the internet. Lazy academics!
I can't believe they teach JavaScript on a computer science course! geez... what happened to algorithms, neural networks, logic gates etc.