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
lara31 [8.8K]
3 years ago
5

Write an application that allows a user to enter any number of student quiz scores, as integers, until the user enters 99. If th

e score entered is less than 0 or more than 10, display Score must be between 10 and 0 and do not use the score. After all the scores have been entered, display the number of valid scores entered, the highest score, the lowest score, and the arithmetic average.
Computers and Technology
1 answer:
lana [24]3 years ago
4 0

Answer:

scores = []

total = 0

count = 0

highest = 0

lowest = 10

while True:

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

   if score == 99:

       break

   

   if score < 0 or score > 10:

       print("Score must be between 10 and 0")

   else:

       total += score

       count += 1

       scores.append(score)

       

       if score > highest:

           highest = score

       if score < lowest:

           lowest = score

           

average = total / count

print("Scores:")

for s in scores:

   print(s, end=" ")

print()

print("The highest score is " + str(highest))

print("The lowest score is " + str(lowest))

print("The arithmetic average is " + str(average))

Explanation:

*The code is in Python.

Initialize the values

Create an indefinite while loop. Inside the loop, ask the user to enter the quiz score. If the score is 99, stop the loop. If the score is smaller than 0 or greater than 10, warn the user. Otherwise, add the score to total, increment the count by 1, and add the score to the scores list. Then, determine the highest and lowest value using if statements.

After the loop, calculate the average.

Print the valid scores, highest score, lowest score and arithmetic average

You might be interested in
Consider the following code: public static void mystery(int a) { System.out.println("A"); } public static void mystery(double a)
Feliz [49]

Answer:

The output is "A"

Explanation:

public class Solution {

   public static void main(String args[]) {

     mystery(7);

   }    

   public static void mystery(int a) { System.out.println("A"); }    

   public static void mystery(double a) { System.out.println("B"); }    

   public static void mystery(int a, double b) { System.out.println("C"); }    

   public static void mystery(double a, int b) { System.out.println("D"); }

}

In the code above; mystery is defined in four different ways called method overloading. Method overloading is when same method is defined with different parameters.

In the first case; mystery will be called if the argument is int.

In the second case; mystery will be called if the argument is double.

In the third case; mystery will be called if the arguments are int and double.

In the fourth case; mystery will be called if the arguments are double and int.

When mystery(7) is called; the mystery method requiring only int will be called and the output is "A".

3 0
4 years ago
What three components should be included in a computer that is used to create TV commercials and music videos? (Choose three.
Vikki [24]

The three components is a specialized video card, large and fast hard drives and specialized audio card.

8 0
3 years ago
Read 2 more answers
A section-lined area is always completely bounded or outlined by an?
Paraphin [41]
Visible outline.
hope this helps
8 0
3 years ago
We see color because an object that has light striking it
Pachacha [2.7K]
<span>We see color because an object that has light striking it reflects the color we see.  The object </span>has certain chemicals in it that when illuminated,  absorbs the color we see, reflects the color we see, <span>refracts all colors but the one we see.</span>
8 0
4 years ago
Select the correct answer.
miv72 [106K]

Answer: Format

Explanation: My head

3 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following is small Java code script that adds functionality to web pages in a browser?
    7·1 answer
  • Which class of fire extinguisher is appropriate for a fire involving electrical/energized electrical equipment?
    13·2 answers
  • Raul converts numbers in base 10 to base 2. Which answer best defends why Raul would need to do this?
    12·1 answer
  • Time (non-statistical) division multiplexing differs from frequency division multiplexing because it:
    5·1 answer
  • Which network device regenerates the data signal without segmenting the network? modem?
    15·1 answer
  • Which can be used to decode a Unicode character encoding into text?
    13·1 answer
  • Which element of the Word program window displays information about the current document, such as number of pages, and also incl
    14·1 answer
  • Help a brotha out..................
    10·1 answer
  • How to transfer word 2019 from one computer to another
    12·1 answer
  • Suppose that you are given the following partial data segment. what value does idtype contain, in decimal?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!