WebFund 2016W: Assignment 1

From Soma-notes
Revision as of 15:19, 11 January 2016 by Soma (talk | contribs) (Created page with "'''This assignment is not yet finalized.''' This assignment is due on January 20th on cuLearn. In this assignment you will writing two programs, <tt>words-sync.js</tt> and <...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This assignment is not yet finalized.

This assignment is due on January 20th on cuLearn.

In this assignment you will writing two programs, words-sync.js and words-async.js. These programs will make use of synchronous and asynchronous I/O is the manner of the programs from Tutorial 1.

These programs should both behave as follows:

  • They should take two arguments, an input text file and an output file to create. Thus you run them by typing "node words-sync.js document.txt wordlist.txt", with document.txt being the file to be read and wordlist.txt is the file to be created.
  • The output file should contain a list of words in the input file, one word per line, with each line terminated by a newline character ('\n'). These words should be sorted in ascending order, as ordered by the standard JavaScript Array.sort() method.
  • Once the output file has been created, the program should output "Finished!" to the console.
  • For the purposes of this program, words can be defined as anything matching the \w operator. In other words, to split the document into words you may call split() using "/\W//" as the split regular expression.

In creating this program, don't forget that you can use standard JavaScript methods such as push(), pop(), shift(), and unshift().

There are ?? points, allocated as follows:

Please submit your answers as a zip file called "<username>-comp2406-assign1.zip", where username is your MyCarletonOne username. This zip file should uncompress to a directory called "<username>-comp2406-assign1" and inside this directory should be three files: "words-sync.js", "words-async.js", and a text file "comments.txt".

"comments.txt" should:

  • list any references you used to complete the assignment (documentation web sites, for example),
  • list your collaborators, and
  • optionally, should discuss any issues or concerns you had when completing this assignment.

Remember that while you are allowed to collaborate with others, plagiarism is not allowed. In other words you should not be copying any code or data directly from anywhere, and any assistance or inspiration should be credited. Any significant code similarity (beyond the code already given to you) will be considered plagiarism and will be reported to the Dean.