subject

Duke and North Carolina have a famous basketball rivalry dating back to 1920. The number of points each team has scored in head-to-head competition over five years is provided in the dukeScores and ncScores arrays. Ex: North Carolina won the first game 76-72 since dukeScores[0] is 72 and ncScores[0] is 76. Write a for loop that examines the dukeScores and ncScores arrays and places "D" in the winningTeam array if Duke won or "N" if North Carolina won, for every game. Ex: winningTeam[0] should be "N" because North Carolina won 76-72, and winningTeam[1] should be "D" because Duke won 74-73. Display the contents of the winningTeam array using a for-of loop. Write a forEach() loop that examines the winningTeam array and determines the longest streak of Duke wins. Display the longest streak to the console, which should be 4. To determine the longest streak, use two variables initialized to 0: streak and longestStreak. Loop through the winningTeam array. Every time a "D" appears, increment streak and then update longestStreak if streak > longestStreak. When an "N" is encountered, reset streak back to 0. When the loop terminates, longestStreak will contain the longest streak.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
What is the largest decimal number that can be represented by a binary number with 4 place values? (remember, each place in a binary number has a value of a power of 2, starting in the ones place with 20.)
Answers: 3
question
Computers and Technology, 22.06.2019 05:00
Modern businesses use different technologies to accomplish work tasks
Answers: 2
question
Computers and Technology, 22.06.2019 19:00
In he example code, what does the title attribute create? a tool tip an element a source a markup
Answers: 1
question
Computers and Technology, 24.06.2019 07:00
You are most likely to automatically encode information about
Answers: 1
You know the right answer?
Duke and North Carolina have a famous basketball rivalry dating back to 1920. The number of points e...
Questions
question
Mathematics, 30.03.2020 15:52
question
Mathematics, 30.03.2020 15:52
question
Mathematics, 30.03.2020 15:52
question
Mathematics, 30.03.2020 15:52
question
Mathematics, 30.03.2020 15:52
Questions on the website: 13722360