Topic 1 - Variables and Data Types
Topic 2 - Conditionals and Strings
Topic 3 - Loops
Topic 4 - Arrays
Topic 5 - File Handling
Semester 1 Projects
Topic 6 - Classes/Objects and Methods
Topic 7 - ArrayLists
Semester Projects

Part 1a: DNAStrand Class

In part 1 of this project, we will mimic how protein is formed from DNA.

Create a DNAStrand class.

  1. Create a method, readDNA, that reads in the dna sequence file by looping through each line. Store the sequence in an Arraylist.
  2. Create another method, createCompliment, which uses the read-in sequence Arraylist and takes in no parameters, iterates through it, and creates its compliment by checking each letter. Store the compliment in another Arraylist. Remember that the compliment to ”a” is ”t” and ”c” is ”g”. The output should keep all strings as LOWERCASE. HINT: Use the string methods.
  3. Create getCompliment and getDnaSequence methods that return the corresponding Arraylist. So getCompliment should return the Arraylist created in createCompliment.