Title image Fall 2018


HW 1: Grammars and Regular Expressions

Due Tuesday February 19 2019

  1. Define an EBNF grammar with the alphabet {a, b} that defines strings that start with an a, have one or more b symbols and end with an a.
  2. Define a regular expression for the prior grammar. Note that you can test regular expressions using the terminal command egrep. You can use the following ABA test file. There are three lines that match the proper specification.
  3. Demonstrate that addition in C is not associative (in the mathematical sense). The following two statements should print significantly different results. You need to figure out appropriate types and values for a, b, and c. Can you do the same with multiplication?
    printf( "%f\n", (a + b) + c );
    printf( "%f\n", a + (b + c) );

HW 0: Hello World with Numbers

Due Tuesday 12 February 2019

Pick a language you do not know and write a program in that language that computes the average of three numbers and prints out the result. Run your code and make sure it works.

Send the professor an email with your code (not as an attachment) and your short answers to the above questions. Please include the phrase "CS333 HW0" in the subject of the email.

Word to the wise: Stephanie uses filters to direct HW emails into the proper folders. At the end of the semester, when she records who completed HW's, she looks in those folders. If an email isn't there because the filter didn't catch it, then you likely won't get credit for that HW.