hw-01 | programming language design - spring'2007, dr. s. yurttas - solution
rationale
This is your second assignment to practice and show that you're able to compose an application using given components by adapting/extending to new uses other than given types.

You'll practice the fundamentals of programming using imperative language abstraction mechanisms in C++ and Java or C# to compose and structure an application using multiple functions/methods.

problem
You'll write an application either in C++ and in C# or Java to locate and count the frequency of any pattern in a set of ranges(n1through n2 inclusive) for each sequence as follows:
      -> dna filenames : dna-filenames.txt

      [ input sequences -
        dna-00 :
        ATCTCTAGTCATA
        TATCTATCTCTCT
        ACTCCTCTTCTCG
        TAGACTAGGACCT
        TCTTATCTATTCG
        GCCTTGTGGACCC

        dna-01 :
        .
        .
        .
      ]

      -> input pattern : tc

      -> range begin : 2
                 end : 6

      -> output filename : dna-counts.txt

      [
        dna-00 :
        ATCTCTAGTCATA - 2
        TATCTATCTCTCT - 1
        ACTCCTCTTCTCG - 1
        TAGACTAGGACCT - 0
        TCTTATCTATTCG - 0
        GCCTTGTGGACCC - 0

        dna-01 :
        .
        .
        .
      ]

      -> range begin : 3
                 end : 8

      -> output filename : dna-counts.txt

      [
        dna-00 :
        ATCTCTAGTCATA - 1
        TATCTATCTCTCT - 2
        ACTCCTCTTCTCG - 2
        TAGACTAGGACCT - 0
        TCTTATCTATTCG - 1
        GCCTTGTGGACCC - 0

        dna-01 :
        .
        .
        .
      ]

      
  • For a given file: list the DNA sequences with count values as above.
  • Filename for the given datafiles read in, interactively, from command-line.
  • You'll do this repetitively until user decides as N, interactively, from the command-line.
  • You'll create one output file per range count.
  • Structuring and composition as static methods in C#|Java or multiple functions in C++ will be the essence of grading; as well as, correctness.
  • You will use and reuse C#, Java, and C++ collections.
credit : 10 points due February 16 by 11pm.

Valid XHTML 1.0 Transitional