1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sveta [45]
2 years ago
5

You are writing a program to help compare two sports teams. A sample member of the list scores is [2. 5] where your team scored

2 and the opponent team scored 5. This part of the program is counting the wins and losses.
What is the missing line of code?

for item in scores:
sum = sum + item[1]
if item[0] > item[1]:
Computers and Technology
2 answers:
Korvikt [17]2 years ago
6 0

Answer:

wins = wins + 1

Explanation:

Edge 2021

Slav-nsk [51]2 years ago
4 0

Answer:

The correct answer is C

Explanation:

You might be interested in
Suppose you have two arrays of ints, arr1 and arr2, each containing ints that are sorted in ascending order. Write a static meth
telo118 [61]
Since both arrays are already sorted, that means that the first int of one of the arrays will be smaller than all the ints that come after it in the same array. We also know that if the first int of arr1 is smaller than the first int of arr2, then by the same logic, the first int of arr1 is smaller than all the ints in arr2 since arr2 is also sorted.

public static int[] merge(int[] arr1, int[] arr2) {
int i = 0; //current index of arr1
int j = 0; //current index of arr2
int[] result = new int[arr1.length+arr2.length]
while(i < arr1.length && j < arr2.length) {
result[i+j] = Math.min(arr1[i], arr2[j]);
if(arr1[i] < arr2[j]) {
i++;
} else {
j++;
}
}
boolean isArr1 = i+1 < arr1.length;
for(int index = isArr1 ? i : j; index < isArr1 ? arr1.length : arr2.length; index++) {
result[i+j+index] = isArr1 ? arr1[index] : arr2[index]
}
return result;
}


So this implementation is kind of confusing, but it's the first way I thought to do it so I ran with it. There is probably an easier way, but that's the beauty of programming.

A quick explanation:

We first loop through the arrays comparing the first elements of each array, adding whichever is the smallest to the result array. Each time we do so, we increment the index value (i or j) for the array that had the smaller number. Now the next time we are comparing the NEXT element in that array to the PREVIOUS element of the other array. We do this until we reach the end of either arr1 or arr2 so that we don't get an out of bounds exception.

The second step in our method is to tack on the remaining integers to the resulting array. We need to do this because when we reach the end of one array, there will still be at least one more integer in the other array. The boolean isArr1 is telling us whether arr1 is the array with leftovers. If so, we loop through the remaining indices of arr1 and add them to the result. Otherwise, we do the same for arr2. All of this is done using ternary operations to determine which array to use, but if we wanted to we could split the code into two for loops using an if statement.


4 0
3 years ago
In some networks, the data link layer handles transmission errors by requesting that damaged frames be retransmitted. If the pro
Usimov [2.4K]

Answer:

The answer with explanation is attached in the file.

Explanation:

Download docx
3 0
3 years ago
How do design elements and color work together on a web page?
KiRa [710]

Answer:

The answer I believe is: 2. Both Enhance visual appeal.

Explanation:

4 0
2 years ago
What is the e-file rejection error for an Invalid bank account or routing transit numbers?
dezoksy [38]
Usually when you encounter the problem you see the error code number "0019" for an invalid bank account or routing transit numbers.

Accounting information is the subject to which this is categorized. As soon as the IRS or (Internal Revenue Service) suspects any error, it will deny the return immediately. 
3 0
3 years ago
What do you think is the most important event in the history of the Internet? What event has had the biggest impact on your dail
lana [24]

Answer:the answer would be this serious when anonimous came to the world or rather when anonymity came

 

Explanation:

The most important events of all the Internet was when anonomous arrived and began to reveal secrets and things against the United States government

 

3 0
3 years ago
Other questions:
  • You've been asked to find the largest number in a range of numbers. Which of the following could you use to find the largest num
    8·1 answer
  • Which type of hacker represents the highest risk to your computer?
    9·1 answer
  • Create an Entity-Relationship Diagram with the following requirements.
    6·1 answer
  • What ipconfig command line option can be used to delete cached dns information from memory?​?
    9·1 answer
  • What is the meaning of 4 8 15 16 23 42?
    14·1 answer
  • Part 2: a) Write VHDL code for a top module that invokes necessary components to display the four decimal digits on four seven-s
    5·1 answer
  • Encoding a video format and then decoding it during playback is one of the functions of MPEG-4 and H.264 file players. MPEG-4 an
    13·2 answers
  • A ______ is a portable device for recording audio and video.
    10·2 answers
  • What is the most vulnerable information that should be protected to prevent unauthorized access to your online files and records
    8·1 answer
  • What is a cyber crime?<br><br>help
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!