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
A common type of non-volatile memory is _____.
lilavasa [31]
SD? RAM? What are you getting at here????
7 0
3 years ago
Both Wireshark and NetWitness Investigator can be used for packet captures and analysis. Which tool is preferred for each task,
NikAS [45]

Answer:

  • <u>packet capture best suited for Wireshark </u>
  • <u>packet analysis best suited for Netwiness</u>

Explanation:

Although both software packages can carry out each task, however, expert network administrators have noted that in terms of effectiveness, the Wireshark software application is best suited for packet capture since unlike Netwitness has no limitation on the size of files it can capture.

Whereas, because Netwitness has a capacity of up to seven-layer protocol analysis, it can perform a more detailed analysis of packets.

5 0
3 years ago
A company was asked to develop a smartphone app to help people locate a car of their choice to purchase from a complex of more t
daser333 [38]

Answer:

the gps and a map

Explanation:

3 0
3 years ago
Read 2 more answers
Tysm for Ace! :O<br> Hurray!
professor190 [17]

Answer:

Good job!! You deserve it.

Explanation:

3 0
3 years ago
Read 2 more answers
Importance of word processing application​
alina1380 [7]

Answer:

Some of the functions of word processing software include: Creating, editing, saving and printing documents. Copying, pasting, moving and deleting text within a document. Formatting text, such as font type, bolding, underlining or italicizing.

Explanation:

8 0
4 years ago
Other questions:
  • A list of the slides in a presentation is found here.
    7·2 answers
  • Which of the following is a preferable method to secure wireless access in a SOHO?
    6·1 answer
  • Write a statement containing a logical expression that assigns true to the
    13·1 answer
  • A restaurant has a case type that allows customer to book the dining room for events. Customers provide basic information includ
    7·1 answer
  • Please help ASAP, will mark brainliest!
    14·1 answer
  • Project 4: Strictly Identical arrays
    7·1 answer
  • When specifying keywords to conduct an internet search, which of the following parts of speech will be the most useful??
    6·1 answer
  • How much memory will be occupied by black and white image​
    8·2 answers
  • Describe how a black and white image could be represented in binary
    11·2 answers
  • In the software development process, which review studies the software design before it is released for coding?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!