Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use Python and complete all questions below. 1. 2. 3. Thank you! You need to write a program that does the following: get numeric

Please use Python and complete all questions below.

1. image text in transcribedimage text in transcribed2.

image text in transcribedimage text in transcribedimage text in transcribed

3. image text in transcribed

Thank you!

You need to write a program that does the following: get numeric inputs interactively from the user, till the user types in s or S to stop the input The numbers need to be between 0 and 5 only The numbers can be repeated The user has to provide a minimum of 12 numbers Once the input phase if complete, a frequency chart for the numbers needs to be provided as the output o Lets say, the user provided the following numbers: 2,3,1,2,2,3,4,3,4,5,4,4,4,4,3,2,2,0,1,1,2,2,3,4,4,4,5 o The following frequency chart should be shown 0:* 1:*** 2: **** 3: **** 4: * 5:** Please employ dictionaries in this part The program should have at least two functions o validate_Input(arguments, as necessary) o draw_Frequency_Chart(arguments, as necessary) Hint: Dictionaries and sorting # Let's work with dictionaries orders { cappuccino': 54, latte': 56, 'espresso': 72, americano': 48, 'cortado': 41 } 1 unsorted # iterate over a dictionary for k,v in orders.items(): print(k,v) # iterate over a dictionary sorted for k,v in sorted (orders.items () ): print(k,v) This program reads input from a text file, process that input text using dictionaries, and write formatted output to another file. The program starts by o first requesting the user to type in the name of the input file, and o then eequesting the user to type in the name of the output file The input file is supposed to contain numbers separated by commas. However, we all know that people make mistakes, or mistakes somehow always creep in. A sample input file (named test_input.txt) is provided for test purposes The file may contain sequences like the following: 12.34,5,5,b3.45,45-4.4, In addition, the file has multiple lines So your task is to read that file and extract and choose all legitimate numeric values. Obe condition for a numeric value being legitimate is that the number should lie between 0 and 10. Once you have the numeric values, you need to draw a histogram and provide summary statistics like: the total count of numbers processed, minimum number and maximum number. A sample output is shown below Important: Instead of sending this output to the screen, this output needs to be saved or written to a file named a2_partBout.txt. I have provided the a2_partBout.txt file that corresponds to the sample input file test_input.txt. Note from the sample output file that you will be creating 10 buckets to count the frequency. So, if a number falls between 0 and 1 ("O to

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions