Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

#questioPurpose of this assignment:
1. Using dictionaries.
Assignment:
Write a program to read a text file and create a dictionary. The keys for the dictionary should be all 26 letters of the alphabet and the values of the dictionary should be the list of all the words which start with the corresponding letter.
The input text file name is: "student_grades_hm_6.txt". Here is a sample input file.
Notice that this is just a sample file and your program must work with other sample files.
General Requirements
• At the top of your program, as a comment, include the following information: (you need to replace the "xxx" with an appropriate number or string)
• Your name (last_name, first_name)
• Your student ID (1000-xxx-xxx)
• Date of submission (yyyy-mm-dd)
• Homework #
• I spent xxx hours on this assignment
• I rate the difficulty level of this assignment as : xxx {a number between 1 and 10. (10 is the hardest)}
• I rate the speed of the coverage of material in this course as: xxx {a number between 1 and 10. (10 is too fast)}
• My comment about this assignment and the course: xxx [Optional comment]
Rules for naming variables and commenting your program:
• You must include proper comments in your program.
• Any variable that you use in your program must have a descriptive name (do not use variable names such as "x")
• Append the type of the variable to the end of the variable using an underscore. For example (grades_list, average_float, name_str).
• If the type of a variable may change in the run time, then append "_mix" at the end of the variable name.
For example (for element_mix in ["yes", "no" , 1, 6]).
• Do NOT use all uppercase letters to name a variable. All uppercase variable names all primarily used for constants.
Notes about input and output
• You MUST use dictionaries.
• The input file may contain other characters such as numbers, punctuation marks, math symbols, ...
• Your program should ignore all other characters (other than alphabetic characters)
• Convert all upper case letters to lower case
• Ignore one letter words such as "a"
• The list of words in the output should be sorted
Sample Input Output
Assuming that the input file "student_grades_hm_6.txt" contains the following text:
And he said:
Your children are not your children.
They are the sons and daughters of Life''s longing for itself.
They come through you but not from you,
And though they are with you, yet they belong not to you.
You may give them your love but not your thoughts.
For they have their own thoughts.
You may house their bodies but not their souls,
For their souls dwell in the house of tomorrow, which you cannot visit, not even in your dreams.
You may strive to be like them, but seek not to make them like you.
For life goes not backward nor tarries with yesterday.
You are the bows from which your children as living arrows are sent forth.
The archer sees the mark upon the path of the infinite, and He bends you with His might that His arrows may go swift and far.
Let your bending in the archer''s hand be for gladness;
For even as he loves the arrow that flies, so He loves also the bow that is stable.
"Khalil Gibran"
Your program''s output should be:
________________________________________
There are 7 words starting with letter " a " :
also , and , archer , are , arrow , arrows , as
________________________________________
There are 9 words starting with letter " b " :
backward , be , belong , bending , bends , bodies , bow , bows , but
________________________________________
There are 3 words starting with letter " c " :
cannot , children , come
________________________________________
There are 3 words starting with letter " d " :
daughters , dreams , dwell
________________________________________
There are 1 words starting with letter " e " :
even
________________________________________
There are 5 words starting with letter " f " :
far , flies , for , forth , from
________________________________________
There are 5 words starting with letter " g " :
gibran , give , gladness , go , goes
________________________________________
There are 5 words starting with letter " h " :
hand , have , he , his , house
________________________________________
There are 4 words starting with letter " i " :
in , infinite , is , itself
________________________________________
There are 1 words starting with letter " k " :
khalil
________________________________________
There are 7 words starting with letter " l " :
let , life , like , living , longing , love , loves
________________________________________
There are 4 words starting with letter " m " :
make , mark , may , might
________________________________________
There are 2 words starting with letter " n " :
nor , not
________________________________________
There are 2 words starting with letter " o " :
of , own
________________________________________
There are 1 words starting with letter " p " :
path
________________________________________
There are 10 words starting with letter " s " :
said , seek , sees , sent , so , sons , souls , stable , strive , swift
________________________________________
There are 11 words starting with letter " t " :
tarries , that , the , their , them , they , though , thoughts , through , to , tomorrow
________________________________________
There are 1 words starting with letter " u " :
upon
________________________________________
There are 1 words starting with letter " v " :
visit
________________________________________
There are 2 words starting with letter " w " :
which , with
________________________________________
There are 4 words starting with letter " y " :
yesterday , yet , you , your
>>>

n..

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9512794

Have any Question?


Related Questions in Computer Engineering

Question suppose an instruction can be carried out in 3

Question : Suppose an instruction can be carried out in 3 stages, the stages taking 3 ns, 7 ns, and 10 ns, respectively. (a) What is the maximum execution rate without pipelining? (b) What speedup is possible with pipeli ...

1 under what circumstances is it advantageous for a company

1. Under what circumstances is it advantageous for a company competing in foreign markets to concentrate its value chain activities in a select few locations? Under what circumstances is it advantageous for a company com ...

You are putting together a trip to kamino to pick up clones

You are putting together a trip to Kamino to pick up clones and need to take a group of droids along to help. You have 11 droids from which to select, and decide to take 4. How many different groups of droids could you t ...

Regarding sorting lists an algorithm such as quicksort was

Regarding sorting lists, an algorithm such as QuickSort was preferred if the list was, for the most part, in random order, and that an algorithm such as Insertion Sort was preferred if the list was essentially in order. ...

The sample distribution on individual iq scores raw scores

The sample distribution on individual IQ scores (raw scores) has a sample mean of 100 and a standard deviation of 16. What proportion of the sample mean will fall at or above a mean of 102.56? Round the answers to no mor ...

1 select one of the topics listed below and discuss

1. Select one of the topics listed below and discuss it. Describe an application that you have to solve by using at least 2 Excel functions. It can be Math, Statistics, Engineering, Financial, etc. Explain what Excel fun ...

This is sports data analysis with python classone way to

This is sports data analysis with python class. One way to judge a basketball lineup is to determine the point differential when that particular combination of players is in the game - in other words, how many points doe ...

Need help with calculation problem and design a program to

Need help with Calculation Problem and Design a program to input two numbers. Calculate the sum, the difference, the product, and the quotient. Display the answers. Car Rental Problem The Sports Car Rental Company rents ...

Review questionsrq web server environment kroenke book chap

Review Questions(RQ) Web Server Environment Kroenke Book Chap 11 The Review Questions (RQ) listed below can also be found in the Kroenke textbook, starting on page 526. This is NOT the entire list of Review Questions, bu ...

Question suppose a network with 109 hostnames not including

Question : Suppose a network with 10^9 hostnames (not including the names of the nameservers themselves) uses non-recursive DNS. Assume that there is a single root nameserver, multiple local nameservers, and M levels of ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As