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
miss Akunina [59]
3 years ago
13

Assign sum_extra with the total extra credit received given list test_grades. Full credit is 100, so anything over 100 is extra

credit. For the given program, sum_extra is 8 because 1 0 7 0 is 8. Sample output for the given program with input: '101 83 107 90'

Computers and Technology
1 answer:
Bond [772]3 years ago
6 0

Answer:

Here is the Python program:

test_grades = [101, 83, 107, 90]      # list of test grades

sum_extra = 0  # stores total sum of extra credit

for i in test_grades:  #loop to check extra credit in test grades

   if i > 100:  # if grade is greater than 100

       i = i - 100  # 100 is subtracted from grade

   else:  # otherwise

       i = 0  

   sum_extra = sum_extra + i #adds i to to sum_extra

print('Sum extra is:', sum_extra) # prints the value of sum_extra

Explanation:

This program assigns sum_extra with total extra credit received in list test_grades. Lets see how this program works step wise.

We have a list with the following elements 101, 83, 107 and 90

sum_extra is initialized to 0

For loop has variable i that works like an index and moves through the list of test_grades

First i is positioned at 101. If condition in the loop checks if the element at i-th position is greater than 100. It is true because 101 > 100. So 100 is subtracted from 101 and i becomes 1. So this statement is executed next sum_extra = sum_extra + i

                  =  0 + 1

So the value of sum_extra = 1

Next i is positioned at 83. If condition in the loop checks if the element at i-th position is greater than 100. It is false to i become 0.So this statement is executed next sum_extra = sum_extra + i

                  =  1 + 0

So the value of sum_extra = 1

Next i is positioned at 107. If condition in the loop checks if the element at i-th position is greater than 100. It is true because 107 > 100. So 100 is subtracted from 107 and it becomes 7. So this statement is executed next sum_extra = sum_extra + i

                  =  1 + 7

So the value of sum_extra = 8

Next i is positioned at 90. If condition in the loop checks if the element at i-th position is greater than 100. It is false to i become 0.So this statement is executed next sum_extra = sum_extra + i

                  =  8 + 0

So the value of sum_extra = 8

So the output of the above program is 8.

Output:

Sum extra is: 8

You might be interested in
Maya enjoys connectedWith her friends and social media apps but one of her friends post a lot of stuff that my thinks it’s annoy
lapo4ka [179]

Answer:

She needs to make time for offline and online activites.

Explanation:

The reason is because if you spend too much time online, you may have anxiety and depression. On the other hand, if you stay offline too much then, you will have trouble focusing on your hobbies, work, etc.

4 0
3 years ago
Based on the module,
svp [43]

Answer:

Explanation:

One group of students did an experiment to study the movement of ocean water. The steps of the experiment are listed below.

Fill a rectangular baking glass dish with water.

Place a plastic bag with ice in the water near the left edge of the dish.

Place a lighted lamp near the left edge of the dish so that its light falls directly on the plastic bag.

Put a few drops of ink in the water.

The student did not observe any circulation of ink in the water as expected because the experiment had a flaw. Which of these statements best describes the flaw in the experiment? (2 points)

Not enough ink was added.

Not enough water was taken.

The dish was too small for the experiment.

The lamp and the ice bag were at the same place.

8 0
3 years ago
The weakest hydrogen line stars are classified as:
Ostrovityanka [42]
O is the weakest hydrogen line
7 0
4 years ago
Read 2 more answers
Which type of attack is one in which a rogue wireless access point poses as a legitimate wireless service provider to intercept
il63 [147K]
Answer: An evil twin attack poses as a legitimate AP.<span />
7 0
3 years ago
For a policy to become enforceable, it must meet five criteria, which are?
Karolina [17]

A policy must be distributed, evaluated, understood, consistent, and followed in order to be enforceable.

What is enforceable?

A legally enforceable right of set-off is one that is valid and recognized in all situations (ie enforceable both in the normal course of business and on the default, insolvency or bankruptcy of one of the counterparties).

Distribution denotes that the policy has been made accessible to all personnel for the evaluation process (through events or notification). The second condition defines the content's readability, taking into account the challenges faced by speakers of foreign languages and complex terms (using simple and precise wording to remove uncertainty).

Understanding the terms of the policy is tested through comprehension, and uniform application of the policy is assessed through consistency. Finally, compliance denotes agreement among all parties to abide by the rules.

Learn more about enforceable policy click here:

brainly.com/question/26984272

#SPJ1

8 0
2 years ago
Other questions:
  • In a _____, if any link between nodes is severed, the entire network is affected, and failure of a single node disrupts the enti
    9·1 answer
  • Which of the following code correctly registers a handler with a button btOK?a. btOK.setOnAction(e -&gt; System.out.println("Han
    6·1 answer
  • is a shell program in Windows that holds individual utilities called snap-ins, designed for administration and troubleshooting.
    11·1 answer
  • Explain what is meant by information technology (IT). Explain what is meant by information systems (IS). Why is it important to
    7·1 answer
  • An assignment notebook works in conjunction with
    7·2 answers
  • What is MS Paint ?<br>Computer <br>short answer​
    14·2 answers
  • What is an a free open source content management system for publishing web content​
    8·1 answer
  • Question 3 (8 marks): Write a program that takes a string from the user and splits it into a list using a space (" ") as the del
    13·1 answer
  • Voice of the customer, Social Media Analytics, churn analysis, survey analysis, and market research analytics are more likely to
    13·1 answer
  • Why should you avoid the use of sarcasm, clichés, and idioms in business<br> letters
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!