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
When did mac start? when did windows start? when did lynux start?
ale4655 [162]

Answer: Macintosh start January 24, 1984

Windows start November 20, 1985

Linux start October 5, 1991

7 0
3 years ago
Read 2 more answers
Suppose you want to view a document that has several headings. what view would you use?
bija089 [108]
Um i think outline. :)
5 0
3 years ago
write a pseudo code and flow chart that take a number as input and prints multiplication table up to 10
Troyanec [42]

PSEUDOCODE:

1. DECLARE number: INTEGER

2. DECLARE multiple: INTEGER

3. INPUT number  

4. FOR counter FROM 1 TO 10 DO

5.     multiple <-- number * counter

6.     PRINT number, " * ", counter, " = ", multiple

7. ENDFOR


<em>1. declaring a variable "number" as an Integer</em>

<em>2. declaring a variable "multiple" as an Integer</em>

<em>3. The user inputs the value of number</em>

<em>4. FOR loop where variable "counter" increments by 1 after every iteration</em>

<em>5. sets the value for variable "multiple" as the value of number * counter</em>

<em>6. prints out for example "3 * 1 = 3" and will continue till counter reaches 10</em>

<em>7. Ends the for loop</em>

FLOWCHART below

hope it helped

8 0
3 years ago
Use System.DateTime along with System.Console to implement a simple C# program that does the following:_______.
Andre45 [30]

Answer:

5

Explanation:

I did it to and it was right

3 0
3 years ago
What is an implicit benefit to Monetary Policy?
Mariana [72]
The answer to your question is a
6 0
3 years ago
Other questions:
  • Create a Python program as described below and save it in a file named bool. You should use IDLE or similar environment to creat
    15·1 answer
  • Andy, a developer, is designing a new program. Which tool should Andy use to help him complete his task?
    13·1 answer
  • Which computer company was named after an orchard? dell, apple, or ibm
    11·1 answer
  • Gta! ! ! !!aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    11·2 answers
  • Write a class called Person that has two data members - the person's name and age. It should have an init method that takes two
    12·1 answer
  • What is the code i need to do
    12·1 answer
  • You were just hired as an IT Specialist for Smalltown School District. Your first assignment is to review a problem area&amp; in
    11·1 answer
  • How to clear a function in functional component react.
    6·1 answer
  • An e-commerce client is moving from on-premise, legacy systems to a cloud-based platform. During the transition, the client is a
    6·1 answer
  • 2023 murano’s available intelligent awd adjusts the ________ to help maintain cornering control.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!