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: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 14:00, camiserjai1832
In which job role will you be creating e-papers, newsletters and preiodicals
Answers: 1
image
Computers and Technology, 24.06.2019 08:20, brinks7994
Which type of entity describes a fundamental business aspect of a database? a. linking b. lookup c. domain d. weak
Answers: 3
image
Computers and Technology, 24.06.2019 21:40, justintintran
Assume you need to test a function named inorder. the function inorder receives three int arguments and returns true if and only if the arguments are in non-decreasing order: that is, the second argument is not < the first and the third is not < the second. write the definition of driver function testinorder whose job it is to determine whether inorder is correct. so testinorder returns true if inorder is correct and returns false otherwise. for the purposes of this exercise, assume inorder is an expensive function call, so call it as few times as possible!
Answers: 1
image
Computers and Technology, 24.06.2019 22:00, josephvcarter
Is the process of organizing data to reduce redundancy. a. normalization b. primary keying c. specifying relationships d. duplication
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 in other subjects: