Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Must be done in python and using linux mint Write a program to ask for a series of part names and prices. Ask for a

Must be done in python and using linux mint

image text in transcribed

Write a program to ask for a series of part names and prices. Ask for a part name until the user enters a blank value. For every valid part name ask for a price. The prices may be floating point values. Fill a dictionary with this data. Once the user has finished entering data ask for a file name. You may use raw_input of fileSaveBox to get the file name. The user may enter a new file name of select an existing file; if they select an existing file overwrite the previous file. Write out each part name/price pair in the dictionary to the data file, one pair per line. Separate the part name and price with a colon, so do not enter a color as part of the part name Run Part 1 AT LEAST TWICE. This will create at least two different data files that can be tested in part 2 Part 2 Write a program that asks the user for a data file and then displays some information about the data First ask the user for the name of the text file. You may use raw _input or fileOpenBox to get the file name. Fill a dictionary with the values from the data file Second, after the dictionary has been filled, write functions that will display various statistical information about the parts. You will have to loop through the dictionary, with either a for or while loop to work with the data. Write a function to display a menu with the following choices, and a function to implement each choice. Do not use a global variable to store the dictionary Display: .The total number of unique parts . All parts with a price greater than or equal to $10 .The smallest price . The largest price . The average of all prices Finally, write a function that will neatly print out the entire list with the values right justified Questions? Ask Kaden or Tom. Sooner is better than later Challenges Modify the program so that is can determine the mode. The mode is the most commonly occurring value Write a program to ask for a series of part names and prices. Ask for a part name until the user enters a blank value. For every valid part name ask for a price. The prices may be floating point values. Fill a dictionary with this data. Once the user has finished entering data ask for a file name. You may use raw_input of fileSaveBox to get the file name. The user may enter a new file name of select an existing file; if they select an existing file overwrite the previous file. Write out each part name/price pair in the dictionary to the data file, one pair per line. Separate the part name and price with a colon, so do not enter a color as part of the part name Run Part 1 AT LEAST TWICE. This will create at least two different data files that can be tested in part 2 Part 2 Write a program that asks the user for a data file and then displays some information about the data First ask the user for the name of the text file. You may use raw _input or fileOpenBox to get the file name. Fill a dictionary with the values from the data file Second, after the dictionary has been filled, write functions that will display various statistical information about the parts. You will have to loop through the dictionary, with either a for or while loop to work with the data. Write a function to display a menu with the following choices, and a function to implement each choice. Do not use a global variable to store the dictionary Display: .The total number of unique parts . All parts with a price greater than or equal to $10 .The smallest price . The largest price . The average of all prices Finally, write a function that will neatly print out the entire list with the values right justified Questions? Ask Kaden or Tom. Sooner is better than later Challenges Modify the program so that is can determine the mode. The mode is the most commonly occurring value

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

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions