Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q1. Write a python code that reads students' total, then print a table with the letter grades and frequencies. The program should also print a

image text in transcribed
image text in transcribed
Q1. Write a python code that reads students' total, then print a table with the letter grades and frequencies. The program should also print a bar chart as shown below in the sample output next page) You are required to use a dictionary to find the frequency of each letter grade. You dictionary should have the letter as the key, and the frequency as the value. Use the following predefined dictionary to map total to letter grades grades = 190: "A', 80:"8,70: "C, 60D, 50: "F) Hint: use division to change a total to 90, 80, 70,60.- 50. For example: if the total is 67, this student should get D, to convert 67 to 60, divide by 10, then convert it to integer. The result will be 6. now you want to be changed to 60, how you could do that? Write the following functions . read data: this method reads the students totals and returns a list of totals count frequency: this method takes the total as a list and returns a dictionary of the grade frequencies print table: this method prints the table print chart: this method prints the bar chart Sample output: How many students do you have? 10 Enter a total: 98 Enter a total: 65 Enter a total: 68 Enter a total: 55 Enter a total: 45 Enter a total: 33 Enter a total: 88 Enter a total: 89 Enter a total: 84 Enter a total 86 Grade Frequency A 1 C D F 0 2 A: 8. C F. 02 (bonus). A company has 3 salesmen and sells 5 different products. Each month the company computes: the total number of sold items of each product, and the total number of sold item for each salesman. Use a list of lists to store the number of products sold by each salesman. Read the number of sold items of each salesman from the user. Then print the total number of sold items for each product and the total number of sold item of each salesman. Sample output: (next page) Enter the number of sold items for salesman o Product : 2 Product 1: 5 Product 2: 3 Product 3: 4 Product 4: 2 Enter the number of sold items for salesman 1 Product : 6 Product 1: 7 Product 2: 2 Product 3: 4 Product 4: 5 Enter the number of sold items for salesman 2 Product : 2 Product 1: 4 Product 2: 3 Product 3:9 Product 4: 6 Number of sold items for product is 10 Number of sold items for product 1 is 16 Number of sold items for product 2 is 8 Number of sold items for product 3 is 17 Number of sold items for product 4 is 13 Salesman o sold a total number of items of 16 Salesman 1 sold a total number of items of 24 Salesman 2 sold a total number of items of 24

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

Microsoft Visual Basic 2017 For Windows Web And Database Applications

Authors: Corinne Hoisington

1st Edition

1337102113, 978-1337102117

More Books

Students also viewed these Databases questions