Question: Problem 2: You are given an incomplete Problem2.py please use this file to complete the following problem. The data file needed for this problem is

 Problem 2: You are given an incomplete Problem2.py please use this

Problem 2: You are given an incomplete Problem2.py please use this file to complete the following problem. The data file needed for this problem is also given, named as DegreesDict.dat import pickle def main) ## Display tables containing information about bachelor degrees earned degreesDict createDictFromFile("DegreesDict.dat") print("1: Display bachelor degrees conferred." print("2: Display percentage change.") print ("3: Display histogram.") print("4: Quit.") Table 5.8 shows the number of bachelor degrees conferred in 1981 and 2010 in certain fields of study Tables 5.9 and 5.10 show the percentage change and a histogram of 2010 levels, while True: TABLE 5.8Bachelor degrees conferred in certain fields Field of Seudy 10 print) choice int(input("Enter one of the options:")) if choice1: 12 200,521 15,121 Computer and info scienoe 9.589 14 15 print() displayBachelorDegreesConferred(degreesDict) 63,642 00,513 elif choice2: 172,780 Social sciences and history Sosace: National Center for Education Scatistics print) displayPercentageChange (degreesDict) 17 TABLE 5.9 Percentage change in bachelor degrees conterred. Field of Study Computer and info. science elif choice3: 19 20 21 print() displayHistogram(degreesDict) % aange (1981-2010) 161.8% 78.7% 71.9% else: Social sciences and history break 23 24 25 def createDictFromFile(fileName): # from binary file -63% pass MLAT? Bachelor degrees conferred in 2010 in certain fields. Computer and info science 39,589 def displayBachelorDegreesConferred(degreesDict): 27 28 29 30 31 pass Engineering72,654 Education101,265 def displayPercentageChange(degreesDict): Social sciences and historyw172,780 pass def fx, y): Source: D Schnieder. Pvthon Pmorammins Write a program that allows the user to display any one of these tables as an option and to quit as a fourth option. ## return percentage change pass Table 5.8 is ordered alphabetically by field of study Table 5.9 is ordered by decreasing percentages, and Table 5.10 is ordered by increasing number of degrees. 35 36 37 38 39 def displayHistogram(degreesDict): pass Use the file DegreesDict.dat that stores a dictionary where each field of study is a key and each value is a two-tuple of the form (number of degrees in 1981, number of degrees in 2010) Onc item of the dictionary is "Business" (200521,358293) main()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!