CS219 Assignments

Brief Table of Contents

  1. August 27
  2. September 1
  3. September 3
  4. September 8
  5. September 10
  6. September 15
  7. September 17
  8. September 22
  9. September 24
  10. September 29
  11. October 1
  12. October 6 (Exam 1)
  13. October 8
  14. October 13
  15. October 20
  16. October 22
  17. October 27
  18. Novemebr 5 (Exam 2)
  19. Novemebr 10
  20. November 12

Full Table of Contents

  1. August 27
    1. Read Chapter 1 and Chapter 2 up to page 49.
  2. September 1
    1. Creat an Eclipse Java project in your student folder named HW1_DNA and create a class named Main. Add a function to our DNA program we developed in class that computes the molecular weight of a strand of DNA. The molecular weight of Adenine is 135.128 grams/mol, Cytosine is 111.103 grams/mol, Guanine is 151.128 grams/mol, and Thymine is 125.107 grams/mol.
            	/**
                * Compute the molecular weight of a strand of DNA.
                * @param dna: A string of ACGT in any case and no other characters.
                * @return The molcular weight of the strand.
                */
                public static double weight(String dna) {
                   ...	    
                }
            
    2. Write a function that returns the character code of the nucleotide that occurs most frequently. Use the function template below:
            	/**
                * Compute which nucleotide occurs most frequently in a DNA strand.
                * @param dna: A string of ACGT in any case and no other characters.
                * @return The character code of the nucleotide that occurs the most..
                */
               public static char max(String dna) {
                  ...
               }
           
    3. Write a function that reverses a DNA strand.
            	/**
                * Reverse a DNA strand.
                * @param dna: A string of ACGT in any case and no other characters.
                * @return The reverse of the dna parameter.
                */
               public static String reverse(String dna) {
                  ...
               }
           
    4. Its often important to compute the reverse complement of a strand of DNA. Write a function to do this (hint, its trivial given that we already have functions for reverse and complement).
            	/**
                * Compute the reverse complement of a DNA strand.
                * @param dna: A string of ACGT in any case and no other characters.
                * @return The reverse complement of dna.
                */
               public static String reverseComplement(String dna) {
                  ...
               }
           
    5. Have your program print the molecular weight of the H1N1 DNA strand in the H1N1.fasta file as well as print the nucleotide that occurs most frequently.
    6. Make sure your program is on the T: drive by the start of class Tuesday September 8 in a folder named HW1_DNA. Also turn in a printout. Make sure there are no bad line breaks in the printout and that methods are commented.
  3. September 3
    1. Finish DNA functions including the DNA complement.
  4. September 8
    1. Reading: Chaper 5 in Learning Java.
    2. Started weather.com temperature scraper. New classes and methods include the URL class, and the indexOf method in the String class.
    3. We also covered core java topics of formal and actual parameters, static and non-static methods, classes vs. objects and constructors.
  5. September 10
    1. Homework 2. In this homework you are going to write a web scraper application similar to the temperature scraper that we wrote in class that extracts the temperature for a given zip code from weather.com. The US government census site allows you to look up the population of any zip code. Go to the U.S. Census Bureau web site at http://www.census.gov and find the population of your hometown.
    2. Write a Java application that allows the user to enter a five digit zip code in a simple dialog box and then displays the population of that zip code in another dialog box. Hint: use the JOptionPane class we covered in lecture.
    3. See what your program should like by running my example on the T: drive in the HW3 directory (folder). Run it through the command line.
    4. Your program should validate the user input by making sure they entered a five digit number (leading and trailing spaces are okay). Hint: look at the trim() function in the String class. If the user entered something other than a five digit integer then you should display a nice error dialog and then start over.
    5. If the user enters a zip code that does not exist (such as 00000 or 99999) then you should also show a nice error dialog and then start over.
    6. To quit the program the user clicks on cancel in the input dialog box and the program should exit quietly.
    7. The program is due in two parts. By next week Thursday September 16 you should have the main of retrieving the population data by zip code with no error checking or dialog boxes. Just hardcode the zip code of 13617 in the URL and display its population. Do not turn in a printout but have a project under your student workspace named HW2 with a class named Main.
    8. By Thursday September 24 you should have the complete program finished. Turn in a printout, stapled. Make surey you use the source code formatter in Eclipse.
    9. Grading. Your program will be graded on correctness and style. Correctness means that your program works in all of the scenarios outlined above. For example with zip codes 13617, 13502, 1a2d4, 99999, and thisisnotazipcode. Style means that you are using methods and functions appropriately. For example, use good variable names, document your methods and break your program up into modular units and implement these as methods and functions. For example, to validate that the zip code is exactly five digits with possible leading and trailing spaces, write a boolean function isValid(zip) that taes a string and returns true if it is valid, false otherwise.
  6. September 15
    1. Modular arithmetic and the % operator.
    2. Reading: Read the Wikipedia entry on a Caesar Cipher.
    3. Reading: reread pages 86 - 92 on Types.
    4. Caesar cipher using modular arithmetic and Unicode.
  7. September 17
    1. Reading: Pages 298 - 307 (Working with text)
    2. Caesar cipher using an alphabet map.
    3. Using a random mapping to generate a code by shuffling a string.
  8. September 22
    1. Reading: Arrays, Pages 118 - 124
    2. Finish random mapping to generate a code by shuffling a string.
    3. Movie Reviews example.
  9. September 29
    1. Reading: Arrays, Pages 118 - 124
    2. Continue with array fundamentals and movie reviews example.
  10. October 1
    1. Reading: Arrays, Pages 118 - 124
    2. Continue with array fundamentals and movie reviews example.
    3. Exam review questions
  11. October 6
    1. Exam 1
  12. October 8
    1. Calculating the average review score for a reviewer
    2. Calculating the average review score for a movie
  13. October 13
    1. Calculating the distance between reviewers
    2. Sorting an array of integers
  14. October 20
    1. Having findReviewer return an object instead of an array index
    2. Sorting reviewers by name
    3. Adding a console based UI to our movie/reveiwer database.
    4. Next programming assignment will be to finish the console UI and related methods. Due Thursday 10/29.
  15. October 22
    1. Begin developing a command line interface for the movie review database.
    2. Organize the user interface in a class named TextUI.
    3. Final command line interface due Thursday 10/29.
  16. October 27
    1. Zip code database. Look at zip_codes.csv
    2. Begin inheritance discussion. Reading chapter 6 titled Relationships Among Classes
    3. Final command line interface to movie database due Thursday 10/29.
    4. Exam 2 is Thursday November 5
  17. November 5 Exam 2
  18. November 10
    1. Swing GUI components.
    2. review the code how we listen for event using ActionListener and MouseMotion listener.
    3. Reading: Chapter 2, 16.
  19. November 12
    1. More Swing GUI components.
    2. Inner classes and JTextArea, JButton, and JMenu
    3. Reading: Inner classes on pages 182 - 192. Swing: Chapter 16, 17.
    4. Homework 4