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]
3 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]3 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
Jenis jenis perangkat keras?
Oksanka [162]
Input, output, dan prosess
3 0
3 years ago
The ability to memorize well is an example of
Soloha48 [4]

personal trait because it something that just comes to mind

3 0
3 years ago
Read 2 more answers
What are personal skills?
jok3333 [9.3K]

Answer:

Basically what you are good at

Explanation:

5 0
3 years ago
DIRECTIONS: Organize your desktop. Name the 5 folders based on the files given below. Organize your own desktop by sorting the g
dem82 [27]

Answer: Music, Documents, PowerPoints, Pictures/Videos, Audios

6 0
3 years ago
If a fire should break out in your building, which of the following actions is NOT recommended?
quester [9]

C) Scream and run

you need to remain calm and carefully exit the building making sure you have everybody with you

6 0
4 years ago
Read 2 more answers
Other questions:
  • What is the most credible website or webpage you have ever visited?Why is it so credible? Describe some of the qualities that ma
    11·1 answer
  • How many questions must you answer in Brainly to be able to message people?
    6·2 answers
  • In which situation will file compression be required to complete the task
    15·1 answer
  • What are features of a product?
    8·2 answers
  • What is the problem with the code snippet below? public class Test { public static void main(String[] args) { System.out.println
    6·1 answer
  • The term ____ describes primary storage devices that are implemented as microchips, can read and write with equal speed, and can
    8·1 answer
  • How is a UDP socket fully identified? What about a TCP socket? What is the difference between the full identification of both so
    9·1 answer
  • For a parking application that lets you pay for parking via your phone, which of these is an example of a functional requirement
    8·1 answer
  • Look at (c), is it accurate? ​
    9·2 answers
  • Instructions: Write a program that calculates the amount of ingredients needed for various flavors of cheesecake.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!