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
Insert a formula that references the appropriate worksheets in cell a3 on the offensive totals worksheet to calculate total pass
Mnenie [13.5K]

In excel spreadsheets, you need to consider specifying relationships between the information you have stored in your spreadsheets when creating formulas. The elements that will help you understand using spreadsheet are the constants, operators, references and functions. This will enable you to use the formulas, without hassle in spreadsheets.

3 0
2 years ago
What is one way interpreted programming languages differ from compiled programming languages? (3 points)
Allisa [31]

Answer:b

Explanation:

3 0
3 years ago
Which column and row references are updated when you copy the formula f$3/15
Tasya [4]

Answer: Column F

Explanation: In Microsoft excel, for the sake of robustness and to aid the effectiveness of updating formulas across cells. The reference of cells are treated as relative which means that when formulas are copied across columns or within rows, they get updated automatically. However, some numbers may be treated as constants such that we do not want them to change or be updated as we move acisss cells. Thus, such numbers are treated Given absolute references, which is made possible by adding a '$' prefix before the colum alphabet or row number or both. in the scenario given above, the row has the $ prefix, hence, it is absolute and will not change but the column alphabet does not and hence, treated as relative.

3 0
3 years ago
Write a second convertToInches() with two double parameters, numFeet and numInches, that returns the total number of inches. Ex:
mixer [17]

Answer:

   public static double convertToInches(double numFeet, double numInches){

       return (numFeet*12)+numInches;

   }

Explanation:

This technique of having more than one method/function having the same name but with different parameter list is called method overloading. When the method is called, the compiler differentiates between them by the supplied parameters. The complete program is given below

public class FunctionOverloadToInches {

   public static void main(String[] args) {

       double totInches = 0.0;

       totInches = convertToInches(4.0, 6.0);

       System.out.println("4.0, 6.0 yields " + totInches);

       totInches = convertToInches(5.9);

       System.out.println("5.9 yields " + totInches);

       return;

   }

   public static double convertToInches(double numFeet)

       {

           return numFeet * 12.0;

       }

       /* Your solution goes here */

   public static double convertToInches(double numFeet, double numInches){

       return (numFeet*12)+numInches;

   }

}

5 0
3 years ago
Select the correct statement(s) regarding antenna and RF wave polarization.
Serggg [28]

Answer:

D

Explanation:

A. Polarization is simple for most antennas to determine. It is only on the same level as the antenna components. A vertically polarised antenna (that is one with vertical elements) is better received and a horizontal antenna is equally provided with horizontally polarised signals.

B. The left-hand circular polarization is named if the electric chambers vector rotates counter-clockwise as far as they are from the antenna.

The right-hand circular polarisation is named as the electric field vector rotates counter-clockwise as far as it gets from the antenna.

It then goes without stating the polarisation on the right hand is orthogonal to the left.

C. signals of the same frequency can be transmitted together in an non-interfering manner as long as their polarizations are orthogonal to one another. This too a correct statement.

8 0
3 years ago
Other questions:
  • You run an automobile selling company that has a popular online store on AWS. The application sits behind an Auto Scaling group
    6·1 answer
  • Using the FAFSA form , you can for apply for what
    14·2 answers
  • Which of the following are valid values for a boolean value in programming? (Select all that apply)
    8·1 answer
  • If your microwave oven is a computer, define its Operating System and User Interface.
    12·1 answer
  • Click to review the online content. Then answer the question(s) below, using complete sentences. Scroll down to view additional
    6·2 answers
  • Two time series techniques that are appropriate when the data display a strong upward or downward trend are ___________ and ____
    14·1 answer
  • 1) Identify at least four examples and uses of application software.​
    5·2 answers
  • What is an automatic update and when should you use it
    10·1 answer
  • A continuous and differentiable function f(x) with the following properties: f(x) is decreasing at x=−5 f(x) has a local minimum
    13·1 answer
  • Data mining requires specialized data analysts to ask ad hoc questions and obtain answers quickly from the system. select one: t
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!