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
How is the JOptionPaneclass used to display a dialog box that performs a yes/noconfirmation?
8_murik_8 [283]

Answer:

JOptionPane.showConfirmDialog() function with the option_type parameter set to JOptionPane.YES_NO_OPTION

Explanation:

JOptionPane is a java swing class which enables users to display different kinds of  standard dialog boxes such as - InputDialog, MessageDialog, ConfirmDialog or OptionDialog.

In order to display a Yes/No confirmation we can use JOptionPane.showConfirmDialog() function. This function takes a parameter called option_type. In order to display Yes/No options for the confirmation dialog, the option_type parameter needs to be set to the value JOptionPane.YES_NO_OPTION.

8 0
3 years ago
13. You're expecting an important call from Mr. Suarez, a potential customer. While waiting for this call, your supervisor calls
8_murik_8 [283]
The answer is call waiting
4 0
3 years ago
What can the tab key do
bulgar [2K]
Answer: it indents

Explanation:
8 0
2 years ago
What is printed to the console?<br> console.log(15 % 4);<br><br> 1<br><br> 2<br><br> 3<br><br> 4
Radda [10]

Answer:

3

Explanation:

7 0
2 years ago
Suppose that you have the following definitions:
spin [16.1K]

Suppose that you have the following definitions:struct time Type struct tourTypen the variable destination of type your type are tourType input(){cout<<"Enter the city, distance and time in hr and min"<>destination.city name;

<h3>What is C++ statements?</h3>

Expression statements. These statements examine an expression for its aspect outcomes or for its go-back value. Null statements. These statements may be supplied in which a declaration is needed with the aid of using the C++ syntax however in which no motion is to be taken.

  1. #include
  2. #include
  3. the use of namespace std;
  4. struct timeType
  5. ;
  6. struct tourType
  7. ;
  8. tourType destination;
  9. tourType input(){
  10. cout<<"Enter the city, distance and time in hr and min"<>destination.cityName;
  11. cin>>destination.distance;
  12. cin>>destination.travelTime.hr;
  13. cin>>destination.travelTime.min;
  14. go back destination;
  15. }
  16. void display()cityName;
  17. d.distance = t->distance;
  18. d.travelTime.hr = t->travelTime.hr;
  19. d.travelTime.min = t->travelTime.min;">
  20. int main().

Read more about the variable :

brainly.com/question/2804470

#SPJ1

6 0
2 years ago
Other questions:
  • Which type of architecture places a firewall in front of the VPN to protect it from Internet-based attacks as well as behind a f
    6·1 answer
  • Due to the internal style sheets of some browsers, your website may look different to someone who is using firefox as opposed to
    11·1 answer
  • Which type of movement lets the player control an object's movement?
    5·1 answer
  • You’re responding to a troubleshooting ticket about a laser printer in HR that isn’t working. According to reports, the printer
    7·1 answer
  • How does technology helps save the environment?​
    6·1 answer
  • Ecommerce sites sell this to generate income
    11·1 answer
  • What is runtime error in Python? Provide an example
    14·1 answer
  • Write a function called printEvens that prints all the even numbers between 2 and 20, inclusive. It will take no arguments and r
    6·1 answer
  • The __________ method can determine whether a string contains a value that can be converted to a specific data type before it is
    12·1 answer
  • How would you assign roles to your group members?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!