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
Vikki [24]
3 years ago
15

Write a program that will ask the user for a set of ten numbers. After all ten numbers have been entered, the program will displ

ay the largest and smallest numbers of the data set. The program will then prompt the user whether he/she would like to enter another set of data. When the user indicates he/she is finished entering data sets, the program will finally display the average largest number and the average smallest number for all sets entered.
Computers and Technology
1 answer:
muminat3 years ago
8 0

Answer:

In Python:

nums = []

larg= []

small = []

while True:

   for i in range(10):

       num = int(input(": "))

       nums.append(num)

   print("Smallest: "+str(min(nums))); print("Largest: "+str(max(nums)))

   larg.append(max(nums))

   small.append(min(nums))

   another = int(input("Press 1 to for another sets: "))

   nums.clear()

   if not another == 1:

       break

   

print("Average Large: "+str(sum(larg)/len(larg)))

print("Average Small: "+str(sum(small)/len(small)))

Explanation:

This initializes the list of input numbers

nums = []

This initializes the list of largest number of each input set

larg= []

This initializes the list of smallest number of each input set

small = []

This loop is repeated until, it is exited by the user

while True:

The following iteration is repeated 10 times

   for i in range(10):

Prompt the user for input

       num = int(input(": "))

Add input to list

       nums.append(num)

Check and print the smallest using min; Check and print the largest using max;

   print("Smallest: "+str(min(nums))); print("Largest: "+str(max(nums)))

Append the largest to larg list

   larg.append(max(nums))

Append the smallest to small list

   small.append(min(nums))

Prompt the user to enter another set of inputs

   another = int(input("Press 1 to for another sets: "))

Clear the input list

   nums.clear()

If user inputs anything other than 1, the loop is exited

<em>    if not another == 1:</em>

<em>        break</em>

Calculate and print the average of the set of large numbers using sum and len    

print("Average Large: "+str(sum(larg)/len(larg)))

Calculate and print the average of the set of smallest numbers using sum and len

print("Average Small: "+str(sum(small)/len(small)))

You might be interested in
can i get an access code for free online? if yes, what website is it so i can get a free access code?​
PIT_PIT [208]

Answer:

Codecademy. Codecademy is one of the most popular free coding websites for beginners.  

freeCodeCamp.  

Coursera.  

edX.  

Codewars. ..

Code Conquest. .

GA Dash. .

Khan Academy (highly recommed)

:

6 0
2 years ago
why backupdocs.com keeps giving computer system update with regards to pdf documents savings? #backupdocuments
prohojiy [21]

The computer system update will ask a question to update pdf documents or not.

<u>Explanation</u>:

  • The computer system update will ask a question to update pdf documents or not.
  • Backupdocs.com is a website used to back up all the data contained in the computer system.
  • Generally, it will ask the user the questions to backup which data and which data should not be backed up.
  • So when we select the backup option it will ask the user to confirm backup or not including all the documents.
  • So backupdocs.com will be giving an update to the computer system regarding the pdf documents savings.

 

6 0
3 years ago
What are 3 websites that talk about density of different gases, density in air, behavior of different gases of earth, convection
Tanzania [10]
I don’t know if this supports all, but try lenntech, duckters, and I will add on later
6 0
3 years ago
The feature that sets Macs apart from other operating systems is the _____.
pochemuha
What truly sets macs apart is the desktop as they don't have a separate tower system like most other systems do
8 0
3 years ago
Read 2 more answers
Method: public ArrayList diff(ArrayList list1, ArrayList list2) {} diff() method accepts two ArrayLists of Integer and returns t
babymother [125]

Answer:

(Assuming Java)

public ArrayList diff(ArrayList list1, ArrayList list2) {

   ArrayList<Integer> union = new ArrayList<>();

   for (int element : list1) {

       union.add(element);

   }

   for (int element : list2){

       if (!union.contains(element)) {

           union.add(element);

       }

   }

   return union;

}

Explanation:

Create an ArrayList that has the union of list1 and list2.

First for loop copies all elements into the union array list.

Second for loop adds all elements that are not yet in the union arraylist to the union arraylist.

(Keep in mind that I assume that you mean a mathematical union, so no duplicates. If this is not what you mean, remove the if statement in the second for loop)

5 0
3 years ago
Other questions:
  • Which three of the following are requirements for receiving federal financial aid for college education?
    14·2 answers
  • What was the name of the system developed by Frederick Winslow Taylor, in which mass production is tied to the cultivation of ma
    10·1 answer
  • The method header of the equals() method within the string class is ____.
    13·1 answer
  • Which set of steps will organize the data to only show foods with more than 100 calories and rank their sugar content from great
    8·1 answer
  • Nina is trying to learn more about how computers work. She has repeatedly read that the motherboard is the "brain” of the comput
    9·2 answers
  • The advantage of an electronic ____ is that the content can be easily edited and updated to reflect changing financial condition
    10·1 answer
  • You are creating a business report for your organization. Where will you find the options to edit the margins of your document?
    11·2 answers
  • Ellen has eggs she wishes to trade for grain. However, she cannot find anyone with grain that needs eggs. What is missing for th
    14·1 answer
  • Give two reasons you should be aware of your computer's system components and their characteristics.
    10·1 answer
  • A pizza delivery restaurant decides to stop hiring drivers and start hiring cyclers to deliver its pizza. The restaurant thinks
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!