CS161 Assignment 4: DNA sequence class



The objective of this assignment to give you more practice in writing classes.

Background: The genetic code is stored in the nucleus of each cell using a molecule called DNA. A DNA molecule is a linear chain of one of the four nucleotides, 'A', 'C', 'G', and 'T'. As computer scientists we think of it as a string over a four letter alphabet. For example, the first few nucleotides in chromosome 22 of the human genome are ATACATATATATG. As you may know, the human genome has been sequenced, so we know (more or less) the full sequence, which contains over 3 billion nucleotides. A first step towards analyzing such data is writing a Java class that can store and manipulate such sequences. We will call this class DNAsequence.
An object of the class DNA sequence is characterized by two pieces of data: a string ID, which is an identifier assigned to the sequence, and the actual sequence. Your class should store these in two variables that are declared as private. Your DNAsequence class is supposed to have the following methods:


Submitting Your Assignment

Submit your DNAsequence.java using the checkin program as PA4.
Note that your code should compile on department Linux machines, and make sure that you are submitting the source code rather than the Java class file.