Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I usually can solve problems like these, but this one is getting on my nerves: P

ID: 3533904 • Letter: I

Question

I usually can solve problems like these, but this one is getting on my nerves: Problem: You will create a program that determines the language of a given input file based on the words in that file. The structure of the input files will be one word per line (all lowercase letters). You should read these words in one LETTER at a time. Each input file will contain 100000 letters, and be in a different language. The way you are able to tell the languages apart is as follows: English: The top letter frequencies are e, i, and a respectively. Danish: The top letter frequencies are e, r, and n respectively. Italian: The letters j, x, y do not exist in Italian (other than proper nouns, which are not present in the input files). Your program MUST include 5 functions in addition to your main() function: 1. A void function that will take an array of size 100000, where each element is a letter from the input file, and another array of size 26 (size of the alphabet), where each element is a number indicating the frequency of occurrence (how often the letter shows up in the first array). This function will be used to fill the second (occurrence) array. The occurrence should be a percentage. HINT: The following code will be helpful when trying to determine which array position in the second array to increment: temp_char = a[i]; // array a is the array of size 100000, with all letters b[temp_char - 'a']++; // b is the array of size 26 2. A void function that will initialize an array of characters of size 26 so that element 0 =

Explanation / Answer

Enjoy!

http://ideone.com/MSvWz0

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote