DOC PREVIEW
UNM CS 241L - CS 241- Lab 02 Counting Characters And Words

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

ReqThe fromwordcompin thnumbthe sepaFor eThisTo bNo ACoul Your1)Th2)To3)No4)Co5) You printand tHintecho quiremenprogram gm the stands and linepletely rewhe line areber, an opeline and tharated by aexample, gs is a pibe the chAtoms casld ever p r program mhis is a o be the o Atoms could ever may assutable charatab,'\t'. : When a co it to the s nts iven in secndard inpues of the iwrite it) so echoed toen parenthhe numbera comma. iven the iniece too hild of Csually toproduce s --John must outpupiece tochild ofcasually r produce --Johme that tacters (deccharacter, standard oLab 2:ction 1.5.4 ut stream input file. o that for eo the stanhesis and fr of wordsnput file, JfairChance, aogether hso beautiDryden ut: oo fair[2f Chance,togethere so beauhn Drydenthe input cimal codec, is read toutput streprintf-1 of 2- The UniveCS 241— Countinaof Kernighand outpuYour taskeach line odard outpufollowed bs in the linohnDrydenand not ohurled iful a wo24,6], and notr hurled[utiful a n[26,2] files conts 32 throuthat is noteam with: f("%c", cersity of N—Data Orgng Charand Line han and Rituts the nuk is to modof the inpuut stream by the numne both in n.txt: of Care.orld. t of Care[33,5] world.[4tain only ugh 126) alt EOF and nc); New Mexicoganization racters,es tchie readsumber of dify this put file, the preceded mber of ch square bre.[43,1040,7] the standlong with nnot '\n', io , Wordss a text filcharactersprogram (o character by the linharacters irackets an] dard ASCInewline,'\nimmediatels le s, or rs ne in nd II ', ly-2 of 2- Turning in your assignment Attach your program file wordCount.c into the Lab 2 assignment in WebCT. Grading Rubric (total of 20 points) [1 point]: The program starts with a comment stating the students first and last name. [1 point]: The program is correctly named. [3 points]: Program compiles without errors or warnings on moons.cs.unm.edu using /usr/bin/gcc with no options. [5 points]: Code follows the hallowed CS-241 Coding Standard - including comments as specified, not repeating code, placement of curly brackets, ... See the course website for the coding standard document under lecture notes. NOTE: Since we will be spending Thursday with Steven Chu rather than going over the coding standard, grading to the standard will be relaxed on this assignment. [10 points]: Correct output for wordCount.in. This file includes 10 records. One point is earned for each line of correct output. This will be graded by a diff test with wordCount.out. The two text files are posted on the class website. diff test: % cp ~joel/public_html/cs241/wordCount.* . % gcc wordCount.c % ./a.out < wordCount.in >myOut.txt % diff myOut.txt wordCount.out The first line copies all files that start with "wordCount." from the website to your current directory. NOTE: the period at the end of the cp command is the <destination> part of the cp command. In the bash shell, '.' means "the current directory". The second line compiles your code. The third line runs your code with the standard input device redirected to the file "wordCount.in" and with the standard output redirected to "myOut.txt". Finally, the last line preforms a character-by-character comparison of your output with the required output. If diff returns silently (without printing anything), then you have passed all


View Full Document

UNM CS 241L - CS 241- Lab 02 Counting Characters And Words

Download CS 241- Lab 02 Counting Characters And Words
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view CS 241- Lab 02 Counting Characters And Words and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view CS 241- Lab 02 Counting Characters And Words 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?