logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Garima ThakurFinance
(5/5)

833 Answers

Hire Me
expert
StatAnalytica ExpertStatistics
(5/5)

877 Answers

Hire Me
expert
Logan AndressonPsychology
(5/5)

780 Answers

Hire Me
expert
Rishab PantMarketing
(5/5)

962 Answers

Hire Me
Others
(5/5)

The input strings will be given from the keyboard. The input strings are assumed to be one-line and the user enters one string

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

1. (6 pt) Write a Python program to create a dictionary for the following pur- pose. You are required to perform frequency listing on multiple strings given as input. Write a function frequency() that takes only one string at a time as input and builds a frequency listing of the characters contained in it. Represent the frequency listing as a Python dictionary and print the result in sorted order on ’key’.

Note: The input strings will be given from the keyboard. The input strings are assumed to be one-line and the user enters one string in each line, and your program must get one-line strings from the keyboard until the user input is end and then print the output for each string. Write this part of the program in a function named q1()

Output Format:

For each of the string inputs, print a dictionary that maps from frequen- cies to letters.

For example:

If first input string =”Never Give Up” and the second string string is end, then the program should create a dictionary:

frequencydict= ’e’ : 3, ’g’: 1, ’i’: 1, ’n’: 1, ’p’: 1, ’r’: 1, ’u’: 1, ’v’: 2

The dictionary ’frequencydict’ indicates that the letters ’g’, ’i’, ’n’, ’p’, ’r’ and ’u’ appear once; ’v’ appears twice, and so on.

Also, sort the dictionary by keys and print the result.

Note: You may assume that the user always inputs a valid one line string (including  end).  The input strings are not case-sensitive, i.e., ’a’ and ’A’ are assumed to be equivalent.

If the first string input by the user is end, then your program must print ”Error”.

Case 1:

Input:

Never Give Up end

Then, your output should be:

{’e’: 3, ’g’: 1, ’i’: 1, ’n’: 1, ’p’: 1, ’r’: 1, ’u’: 1, ’v’: 2}

Case 2:

Input:

Never Give Up Balloons are blue end

Then, your output should be:

{’e’: 3, ’g’: 1, ’i’: 1, ’n’: 1, ’p’: 1, ’r’: 1, ’u’: 1, ’v’: 2}

{’a’: 2, ’b’: 2, ’e’: 2, ’l’: 3, ’n’: 1, ’o’: 2, ’r’: 1, ’s’: 1, ’u’: 1}

2. (4 pt) Write a python program to find the lower left corner (minimum x and minimum y value) for a list of point locations and print it. Input the list of point locations from the keyboard. Each point location will be input in a different line until   end is typed in. Consider the following case as an example.

Input :

1.2,2

5,4

2,3

6,5

end

Then your  Output  should  be  :  (1.2,2.0) Write this program in a function named q2().

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme