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
ludmilkaskok [199]
4 years ago
5

A teacher wants a program to give extra points to students who fail a test. Write a Python program to do the following: (a) Ask

the user to enter 5 test scores. Store the scores in a list. Display the list. (b) Copy all 5 test scores to another list. Use a loop to examine each test score in the new list. If the score is below 60, add 10 extra points to the score. Display the list. (c) Compare the old score and new score of each student. If the old score and new score are different, display the two scores.
Computers and Technology
1 answer:
Lorico [155]4 years ago
8 0

Answer:

Hi there! Please find the answer below.

Explanation:

The program below demonstrates how each of the requirements can be coded in a simple Python script. To copy the array, we can use the copy() method of the array. To calculate the diff, we can use a few different techniques, so I have implemented it using a loop over the arrays and just storing and displaying the difference in the 2 arrays.

new_string.py

def add_test_score(score):

 test_score.append(score);

contact_hash = {}

test_score = []

print("Enter 5 test scores: ");

for x in range(0, 5):

   input_string = input("Enter test score " + str(x + 1) + ": ")

   add_test_score(int(input_string));

print(test_score);

test_score_copy = test_score.copy();

for e in test_score_copy:

   if e < 60:

       test_score_copy[test_score_copy.index(e)] += 10;

diff = [];

for e in test_score:

   print(test_score[test_score.index(e)]);

   print(test_score_copy[test_score.index(e)]);

   if not test_score[test_score.index(e)] == test_score_copy[test_score.index(e)]:

       diff.append(e);

print(diff);

You might be interested in
Client/server networks are controlled by a central server that runs a specialized piece of software called
Marta_Voda [28]
It is called a wired hot spot

6 0
4 years ago
Explain why you will do these prarticular things when driving
VashaNatasha [74]
What things?????? Are u talking about
4 0
3 years ago
Hi who plays among us
Ray Of Light [21]

Answer:

Me

Explanation:

Lol

8 0
3 years ago
Your friend is applying for a job at your company. She asks you to recommend her. She wants you to tell your boss that you have
Gekata [30.6K]
I think you should tell her you cannot lie about working with her
7 0
3 years ago
Your digital footprint says a lot about you, but not everything is true or accurate. When you're a high school or college studen
Aleks [24]

Answer:

yes

Explanation:

cuz im yearz old

7 0
3 years ago
Other questions:
  • The Law of Increasing Opportunity Costs requires greater ______ of one good in order to produce ______ of another good.
    11·2 answers
  • How does a combustion engine works?
    7·2 answers
  • Twitter, Foursquare, and other real-time media add to or leverage capabilities of smartphones--improving your ability to be well
    9·1 answer
  • When considering changing the content of a cell which button should you press to leave the cell as it originally was?
    13·2 answers
  • Create a Python program by defining a function that calculates the year of birth of a person whose age is known to you.(You may
    7·1 answer
  • Meghla has brought a smartphone with length is 4 unit and breadth is 3 unit, what is the screen size of the smartphone
    12·2 answers
  • Histogram 9AMAA 12/01/2021.
    9·1 answer
  • Good Morning! Please Help!
    15·1 answer
  • They will wash the car change into tag question​
    6·1 answer
  • Click this link to view O*NET’s Work Activities section for Manicurists and Pedicurists. Note that common activities are listed
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!