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
RUDIKE [14]
3 years ago
6

Write a program that prompts the user to enter a series of numbers between 0 and 10 asintegers. The user will enter all numbers

on a single line, and scores will be separatedby spaces. You cannot assume the user will supply valid integers, nor can you assumethat they will enter positive numbers, so make sure that you validate your data. You donot need to re-prompt the user once they have entered a single line of data. Once youhave collected this data you should compute the following: • The largest value • Thesmallest value • The range of values • The mode (the value that occurs the most often) •A histogram that visualizes the frequency of each number Here’s a sample running of theprogram.
Computers and Technology
1 answer:
Anna71 [15]3 years ago
7 0

Answer:

The program in Python is as follows:

import collections

from collections import Counter

from itertools import groupby

import statistics

str_input = input("Enter a series of numbers separated by space: ")

num_input = str_input.split(" ")

numList = []

for num in num_input:

         if(num.lstrip('-').isdigit()):

                   if num[0] == "-" or int(num)>10:

                             print(num," is out of bound - rejecting")

                   else:

                             print(num," is valid - accepting")

                             numList.append(int(num))

         else:

                   print(num," is not a number")

print("Largest number: ",max(numList))

print("Smallest number: ",min(numList))

print("Range: ",(max(numList) - min(numList)))

print("Mode: ",end = " ")

freqs = groupby(Counter(numList).most_common(), lambda x:x[1])

print([val for val,count in next(freqs)[1]])

count_freq = {}

count_freq = collections.Counter(numList)

for item in count_freq:

         print(item, end = " ")

         lent= int(count_freq[item])

         for i in range(lent):

                   print("#",end=" ")

print()

Explanation:

See attachment for program source file where comments are used as explanation. (Lines that begin with # are comments)

The frequency polygon is printed using #'s to represent the frequency of each list element

You might be interested in
Why was the cooper black font made?
Lelu [443]

Answer:

Explanation:

Cooper Black is an ultra-bold serif typeface intended for display use that was designed by Oswald Bruce Cooper and released by the Barnhart Brothers & Spindler type foundry in 1922.

8 0
4 years ago
Chelsea is writing a paper about the value of running every day. She wrote this thesis statement:
Masteriza [31]

Answer:

no cloo

Explanation:

8 0
3 years ago
Where is voice data stored in Android?
Dafna1 [17]
Inside its internal hard-drive and your google account!
8 0
3 years ago
You choose Option A for Overdraft Options. What would happen if you had $30 in your checking account and you tried to take out $
Serga [27]

The overdraft transaction will be successful and $45 will be paid at the grocery store but there will be an overdraft charges in addition to $15.

Overdraft is a privilege granted to checking account holder which good credit record.

  • Overdraft privilege allows payment for transaction even though there's not enough funds in the bank account to fully cover the transaction.

  • An Overdraft Fees will be charged for the service provided by the bank in addition to the amount provided to the bank-holder.

In conclusion, the payment at the grocery store will be successful but the account will be in negative of $15 and an overdraft fee will be charged by the bank as well.

Read more on Overdraft here

<em>brainly.com/question/17154998</em>

6 0
3 years ago
A user is attempting to access a shared file locally on their workstation. The file has Full control NTFS permissions assigned,
BaLLatris [955]

Answer:

The answer is read only permission

Explanation:

The effective permission for the user is the read only permission.

8 0
3 years ago
Other questions:
  • Question 1 : Which statement is true about interlaced images? This task contains the radio buttons and checkboxes for options. T
    8·1 answer
  • Two technicians are explaining automotive computer control. Technician A says that the volt is used as a signal for a computer-c
    13·2 answers
  • Tara and Zach are leading a systems development project and they want the investigation phase to go smoothly and quickly. They d
    5·1 answer
  • Daniel has a list of numbers that are not in any order. He wants to find the order of the numbers with the help of a spreadsheet
    10·2 answers
  • when using presentation software, which menu can you use to duplicate a slide to use as a template for a new slide?
    14·1 answer
  • The manager of the Super Supermarket would like to be able to compute the unit price for products sold there. To do this, the pr
    13·1 answer
  • Define client and.server​
    13·1 answer
  • Selective colleges choose to have in-person meetings to learn more about the applicants. These meetings are called:
    8·2 answers
  • 1.Blocul care asigura impedanta necesara la intrarea aparatului de masurat numeric este:
    13·1 answer
  • n (m,n) correlating branch predictor uses the behavior of the most recent m executed branches to choose from 2m predictors, each
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!