- Please put a header that contains at least your name, section, date and brief description what program does!
- ID: ***0997      Grade: 7/10
- Case analysis is ok. Implementation is fine. You read a file into string by using tokens.
Then you searched for start codon by using indexOf() which is ok. You found out stop codon using substring() and endsWith() method.
- Line 61: next starting position should be at k+1 not at k+sub.length(). It turns out that we can have another starting
codon inside found protein.
- Line 74: "protein=protein+amino;" you need to reset protein to an empty String before entering into for loop at line 65.
If you don't do that, protein will accumulate all sequences (that is why you have repeats in your output).
- Nice printing.
- Counters are not implemented.
- ID: ***3594      Grade: 4/10
- Case analysis could be better. Most of it is problem statement. It looks like you run out of time.
You should practice to write case analysis before writing the code (or at least while coding).
- Logic is off in most of the statements related to indexing. You definitely need more practice on this.
- Search for stop codon: you find first occurrence of stop1, first occurrence of stop2 and first occurrence of stop3,
then a minimum index of these three and if the length of substring is not divisible by 3 - nothing is done, you search for another start.
This is not correct. You need to find stop codon. If the closest stop doesn't work you need to check next one and so on till you find
one that gives you substring divisible by three.
- Line 123: "if(firstOccurrence < location2) firstOccurrence = location2;" this line finds maximum of firstOccurence and
location2 not minimum, hence it does not find the first occurrence.
- It is not clear why you subtracted 1 from location. It looks like you wanted to point to end of substring.
Check this out: s="ATGCCCATAG"; s.indexOf("tag") returns 7, then place=6, difference=3, it seems that length of substring "CCCA"
is divisible by 3. Is it for real? You should be careful with "off by 1" errors.
- Redundant variables - place, firstOccurence, diference, test...
- Printing is not ok, what would happen if length of substring is 570? You will print out first 70 characters in the first line
and next 500 characters in the second line. The idea is to print out in chunks of 70 characters.
- Counting is not ok, logic is off. You add amino acid to a protein and then pass it to howManyTimes() where you parse protein and
increment counters. Each time you add up amino acid you parse protein from the beginning.
- ID: ***9766 Grade: 6/10
- Case analysis is good.
- When we use command line parameters we should check if user provided exact number of parameters. If he didn't,
we should print out some message saying how program should be used.
- Nice searching for stop codon. However, you need to check if you exited a loop because you hit the end of the string or
because you found a stop codon. If you hit the end you should not write out to the file.
- It turns out that we can have another starting codon inside protein. Start should be incremented by 1 always.
For example, you could have cursor substart that you will use to go through substring.
- Printing is not correct. You should break line into chunks of 70 characters.
- Counting is not implemented.
- ID: ***9690      Grade: 1/10
- Program does not compile. You missed a bracket after line 34. When I fixed it, it showed another error in
line 15: getProtein(int) in DNA cannot be applied to a.getProtein(codon, console). You mixed up methods from Tempt and DNA classes.
- There is no case study.
- You should read from a file not from user.
- I do not understand the code at all.
- ID: ***5242      Grade: 2/10
- Case analysis is weak. Main focus is on reading from a file, not actual problem you were supposed to solve.
- Program does not compile. Line 66: it should be PrintWriter instead of PrintWtriter.
- What you did is declaration of variables, some reading from a file and that's it.
- ID: ***8936      Grade: 5/10
- Program does not compile. Error is in line 50, it should be 3*k instead of 3k. When fixed, it reported additional errors,
like it cannot find symbol PrintWriter (you forgot to import .io) etc.
- Case analysis is good.
- You should read filename from a command line. It should not be fixed inside the code.
- Nice try but program is in bad shape.
- Line 44: I do not see why you need to initialize a to s.indexOf("atg"), it will work wit 0 too.
- Line 68: is 31 here just for testing purposes?
- It turns out that we can have another starting codon inside protein. Line 60 should be "a = s.indexOf("atg",a+1);"
instead of "a = s.indexOf("atg",a+aProtein.length());"
- Nice ideas for counting and printing.