C代写 Assignment 2代写R编程、R程序代做、代写R编程

Introduction按照题目要求输入首先是行数,然后是行数行的文本需要生成的assign2.txt在src文件夹下void GetWord(char str,char word){int i;int j;int l;char tmp[82];word[0]=’\0’;l=strlen(str);i=0;j=0;while(iRequirement60-141 – Introduction to Programming II Summer, 2017Assignment 2(Submission Deadline: Wednesday, Jul. 19, 2017 before 23:59)Text AnalysisThe availability of computers with string-manipulation capabilities has resulted in some ratherinteresting approaches to analyzing the writings of great authors. Much attention has been focusedon whether William Shakespeare ever lived. Some scholars find substantial evidence thatChristopher Marlowe actually penned the masterpieces attributed to Shakespeare. Researchershave used computers to find similarities in the writings of these two authors. Regardless of thisparticular controversy, this assignment examines three methods for analyzing texts with a computer.Your task is to:Write a complete, well documented C program that reads several lines of text and prints three tablesindicating:1) the number of occurrences of each letter of the alphabet in the complete text2) the number of one-letter words, two-letter words, three-letter words, and so on, appearingin the complete text3) the number of occurrences of each different word in the complete textNote that the term “complete text” used above refers to all characters in all lines of inputted text.Requirements and Hints :1. Given several lines of text, your program should implement at least the following functions (inother words, additional functions may be useful, depending on the approach used):a) void letterAnalysis( ), that gets several lines of text and the number of lines of text as inputparameters and prints a table indicating the number of occurrences of each letter of thealphabet in the complete text.b) int wordLengthAnalysis( ), that gets several lines of text, the number of lines of text and alength as input parameters and returns the number of occurrences of words with that lengthappearing in the text. The main() function should call this function with different word lengthsand then prints a table indicating the number of one-letter words, two-letter words, three-letterwords, and so on, in the text. The maximum word length may be assumed to be 20 letters.c) void wordAnalysis( ), that gets several lines of text and the number of lines of text as inputparameters and prints a table indicating the number of occurrences of each different word inthe text. The program should include the words in the table in the same order in which theyappear in the text.Input:Input is a number (say, int N) and several (i.e. N) lines of text from a file (using input redirection) orfrom the user (using standard keyboard input). For this, first the number (N) of text lines should beread, and then each line of text should be read individually. The maximum number of lines is 10 buteach text line might have different lengths (however, the maximum number of characters in anyindividual line is 80).Hint: You can use a two dimensional array or an array of pointers to save the text lines.For example4To be, or not to be? That is the question:Whether ’tis nobler in the mind to sufferThe slings and arrows of outrageous fortune,Or to take arms against a sea of troubles,Output:The table below is intended to illustrate the output for this assignment, but it is presented for visualconvenience only. Your program will actually produce the output reports so that various outputs aregenerated one after another (First output, followed by Second output, followed by Third output). Inparticular, note the formatting issues to be dealt with. For the First output, the letter count must beright justified in a column of prescribed width. For the Second output, the word “word” is used onlyif the number of words is 1, otherwise “words” is used. FC代写 Assignment 2代写R编程、R程序代做、代写R编程inally, for the Third output, “times” is usedonly when the number of occurrences is greater than 1.First output Second output Third outputTotal letter counts:a: 10b: 4c: 0d: 2e: 15f: 5g: 3h: 6…1 word of length 110 words of length 28 words of length 34 words of length 45 words of length 62 words of length 71 word of length 82 words of length 91 word of length 10“To” appeared 1 time“be,” appeared 1 time“or” appeared 1 time“not” appeared 1 time“to” appeared 3 times“be?” appeared 1 time“That” appeared 1 time“is” appeared 1 time…Note: You do not have to separate punctuation marks (such as comma, dot, or question mark) fromthe words. For example, both “be,” and “be?” counted as a three-letter words above.Requirements:- Write and document a complete C program that is capable of satisfying the requirements of thisassignment problem.- UNDOCUMENTED OR POORLY DOCUMENTED code will automatically lose 50% marks.- PLAGIARIZED work will not be graded and receive a mark of ZERO and reported according to theSenate bylaws.- The question can use of I/O redirection. Please review the textbook for an example on using I/Oredirection from flat files.- TO SUBMIT: No later than the submission deadline, your assignment should be uploaded inBlackboard. Late submissions are not accepted and will receive a mark of ZERO.- Upload your work as an attachment, include both the source file (assign3.c) and the script. file(assign3.txt) - see below how to create the script. file.To create a script. file (one that logs your compilation steps and your output in a text file):1. script. assign2.txt2. cat assign2.c3. cat input.txt4. cc assign2.c5. a.out 6. ls -l7. exit (DO NOT FORGET THIS STEP!!)The example script. execution presumes that the input was specified in the file input.txt. This may bechanged if the input is provided interactively within the program.If you are compiling your code under Cygwin shell, then you need to change line 5 to:5. ./a.exe In line 4, students may prefer to use the gcc compiler to ensure improved warning and errordiagnostic reports from compiling the program. You must have access to gcc in order to make thischange, however.NOTE: Submissions that are not received correctly by the deadline will automatically receive aZERO mark. Late assignment submissions are not accepted!NOTES:1. Your assignment must be RECEIVED by the due date and time. Late assignment submissions areNOT accepted. Keep your script. file, and all your code unmodified as proof of its completion in caseit is not received.2. It is your responsibility to get an early start on the assignment, research and ask questions aheadof time from the due date.3. Marks will be deducted for unclear code (improper spacing and alignment, hard to read programsand missing outputs).4. Make sure you turn in a complete script. file that clearly shows: your code, your compilationprocess, a listing of the directory showing your source file(s) and the a.out with the date/time stamps,and the output. DO NOT SUBMIT a.out FILES!5. PLAGIARISM: CHEATING IS NOT TOLERATED – PLAGIARISM IS CHEATING! You mustsubmit your own work. Students who are suspected of copying someone else’s work will be reportedto the department’s chair and the Dean of Science and be dealt with in accordance with theUniversity policies. You should not share your code with others. Codes that are similar to each otherwill BOTH be reported as potential evidence of copying. It is imperative that you write your own code.6. Authorized/limited help on this assignment may be provided directly from your Lecture or Labinstructors and Teaching Assistants.转自:http://ass.3daixie.com/2019030627560476.html

推荐阅读更多精彩内容