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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:50
17. implement the jvm dload instruction for the mic-2. it has a 1-byte index and pushes the local variable at this position onto the stack. then it pushes the next higher word onto the stack as well
Answers: 2
question
Computers and Technology, 22.06.2019 20:00
What is the worst-case complexity of the maxrepeats function? assume that the longest string in the names array is at most 25 characters wide (i.e., string comparison can be treated as o( class namecounter { private: int* counts; int nc; string* names; int nn; public: namecounter (int ncounts, int nnames); int maxrepeats() const; }; int namecounter: : maxrepeats () { int maxcount = 0; for (int i = 0; i < nc; ++i) { int count = 1; for (int j = i+1; j < nc; ++j) { if (names[i] == names[j]) ++count; } maxcount = max(count, maxcount); } return maxcount; }
Answers: 3
question
Computers and Technology, 23.06.2019 02:30
Rafael needs to add a title row to a table that he has inserted in word. what should he do? use the alignment options. use the merge and center option for all the cells in the top row. use the merge and center option on the first two cells in the top row. none of the above
Answers: 3
question
Computers and Technology, 23.06.2019 04:31
Q14 what is most important for you to choose before you build a network? a. private network b. nos c. network media d. network protocol e. directory service
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
Questions on the website: 13722361