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
gayaneshka [121]
3 years ago
6

What does the following program do? student = 1 while student <= 3: total = 0 for score in range(1, 4): score = int(input("En

ter test score: ")) total += score average = total/3 print("Student ", student, "average: ", average) student += 1
Computers and Technology
1 answer:
OLga [1]3 years ago
6 0

Answer:

This program prompts for 3 score inputs and calculates the average score (of 3 Test scores) and repeats the process for 3 different students.

Explanation:

the programming language used is python

This is how the code should naturally look like:

student = 1

while student <= 3:

   total = 0

   for score in range(1, 4):

       score = int(input("Enter test score: "))

       total += score

       average = total/3

       print("Student ", student, "average: ", average)

  student += 1

To explain further i.e line by line

student = 1

This indicates that the scores that the program will prompt you to enter belong to the first student  

while student <= 3:

This is a continous loop that breaks only when the student number exceeds 3 (it lets you know that you're iterating over this program 3 times)

total = 0

this initializes the total score to zero. In python this is how variables are initialized an and assigned a data type especially when they will be used again within the program.

for score in range(1, 4):

      score = int(input("Enter test score: "))

The FOR loop is another control structure within the code. It allows you to Iterate between the range 1 - 4 ( i.e. 1,2,3) and prompts you to enter a test score 3 times.

total += score

for each time you are prompted to add a test score, the score is added to the total.

average = total/3

This line calculates the average by dividing by 3

print("Student ", student, "average: ", average)

This line prints out the student number and average score.

e.g: Student 1, average: 14

student += 1

This adds 1 to the previous students number to iterate to the next student.

Final Note: This code can be used for taking students test scores and calculating their average and can be modified further to check if a student passed of failed.

You might be interested in
The method main of a class is called when you instantiate an object of that class like this: Box myBox = new Box();
WINSTONCH [101]

Answer:

The answer is "Option A"

Explanation:

In the OOPs programming language, the class and object concept is used, in which class is a collection of data members, and member function and object is known as real-time entity. In the class when the main method is created, so inside this method class object is created that's why the answer to this question is true.

7 0
3 years ago
Round Robin Algorithm
Reil [10]

Answer:

Please check the attachment.

Explanation:

avg turnaround time = (38+7+42+33+18)/5= 27.6

avg waiting timee = (33+5+28+23+17)/5= 21.2

And its D, A C in Gantt chart at last and exit time are 33, 38 and 42 mentioned as last three in Gantt chart.

7 0
3 years ago
How does limiting a company's scope benefit the company? A. It encourages the company to use division of labor. B. It makes it e
Luda [366]

Answer

It makes it easier to produce a high quality product.

Explanation

Project scope is the part of project planning that involves determining and documenting a list of specific project goals, deliverable, tasks, costs and deadlines. in Project management it  involves the planning and organization of a company's resources to complete a specific task, event, or action and is usually a one-time event. It is an activity that is engaged in for the primary purpose of making a profit. These activities includes things like  production, operations, marketing, and administration

6 0
3 years ago
Read 2 more answers
Why is art important to heritage?
Sophie [7]
<span>but of culture, values and traditions. Cultura</span>
7 0
3 years ago
Which is an acceptable practice when a photographer shoots in windy conditions?
VARVARA [1.3K]

Answer:

d) attach a bag of weights to the tripod

Explanation:

5 0
4 years ago
Other questions:
  • Q3** Write a query to create a new price list for books written by the same author. Allow the user to enter only the first 4 let
    15·1 answer
  • About ___% of children score within one standard deviation above or below the national average in intelligence.
    5·1 answer
  • Write the definitions of two classes Day and Night. Both classes have no constructors, methods or instance variables. Note: For
    8·1 answer
  • In which type of land contract does the seller earn interest on the difference between what the seller owes on an existing loan
    14·1 answer
  • Which represents the hierarchical structure of a Google Analytics account from top to bottom?
    5·1 answer
  • Which command can be used to find errors on a hard drive​
    6·1 answer
  • First let 2161965 answer<br> and then you ..
    11·2 answers
  • State True or False: 1. Application software can run without the presence of system software. 2. . A language processor translat
    14·1 answer
  • Positive use of the technology before the pandemic.
    8·1 answer
  • 11.6 Code Practice edhesive
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!