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
* Create a list of places and situations in which we use a computer
Vinvika [58]

Answer:

Place:

Coffee shop. Railway Reservation System, Airport Reservation System, Machine learning and a long list follow.

Situation:

We find that there is a similar type of calculation and in bulk. Thus we can create a piece of software, and run that with the help of a computer to solve our problem of tackling the massive number of clients.

Description:

The situation demands a similar sort of calculation, and we can hence make a program or most favorably a software that can do all these calculations for us. A perfect example is a coffee shop, which has 100 to 1000 customers drinking coffee each second. And you can understand how badly they need a computer and software. This cannot be done manually.

Explanation:

Please check the answer section.

5 0
4 years ago
Mrs. Jackson wrote a newsletter to the customers of her housecleaning business that included some organizational tips they could
nika2105 [10]
The correct answer is a. effective communication

- - -
Ineffective and barriers to communication are problems that make communication unclear. Workplace communication is at work or at a job. This is not a job newsletter for workers, but for people at home.
5 0
4 years ago
Read 2 more answers
Which is a requirement for searching for a template
Lina20 [59]

Answer:

umm... you did not discribe the anwsers, i cannot help you

8 0
3 years ago
A technician is configuring the Windows computers on a network to print to a printer that is directly connected to the network v
finlep [7]

Answer:

Network Printer

Explanation:

A network printer is a type of printer that is accessible by network connections, making it available for use by other computers connected to that network. The network can either come from the printer or from a local computer provided to create network for the printer. Most of them contains a network interface card that allow them connect directly to a local network from which computers can then access them. This is different from a local printer that is directly connect to the computer via USB cable.

Network printer is very advantageous in that multiple network computers can access the printer at thesame time.

7 0
3 years ago
True or False?
Nadya [2.5K]

False.

The different between break and continue instruction is that with break you exit the loop, and with continue you skip to the next iteration.

So, for example, a loop like

for(i = 1; i <= 10; i++){

   if(i <= 5){

       print(i);

   } else {

       break;

   }

}

will print 1,2,3,4,5, because when i=6 you will enter the else branch and you will exit the loop because of the break instruction.

On the other hand, a loop like

for(i = 1; i <= 10; i++){

   if(i % 2 == 0){

       print(i);

   } else {

       continue;

   }

}

Will print 2,4,6,8,10, because if i is even you print it, and if i is odd you will simply skip to the next iteration.

6 0
3 years ago
Other questions:
  • Can a Web developer guarantee that data presented is valid? Why or why not?
    9·1 answer
  • Betty took her friends bowling. they rented 4 lane. 10 people need rent shoes and
    12·1 answer
  • Why might your digital footprint be important when you are applying for collage
    13·1 answer
  • Are the actions legal or illegal?
    13·1 answer
  • Which of the following function headings arevalid? If they are invalid, explain why.
    12·1 answer
  • The first step in the information processing cycle is _____, which involves entering data into the computer.
    8·1 answer
  • Please help thank you !!!
    7·2 answers
  • Informed _________ will better manage complexities and enable more efficient manufacturing of goods.
    13·1 answer
  • What is the best food to eat before workout? why?​
    10·2 answers
  • Select all the correct answers.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!