COM3113 -- Fundamentals of Programming -- Assignments
College of Computer Science -- Northeastern University
Fall Quarter 2001
Assignment 2
Due by the end of Monday, October 1st.
Part 1: Reading Assignment
Developing Bioinformatics Computer Skills
Chapter 4 Files and directories in Unix
Page 64 to Page 86
Part 2: Coding Assignment
Compute the percentage of four bases in a sequence
Scan the sequence string, count the numbers of A, T, C and G and calculate the
percentage of each base.
For example:
in sequence" ATTGCCCTTA"
#A: 2 %A: 20%
#C: 3 %C: 30%
#G: 1 %G: 10%
#T: 4 %T: 40%
Using command line instead of Java Applet
- Write a java file
- javac yourFileName.java
- java yourFileName
Hard-coded the sequence in your code
-
Assign the initial value of your sequence string inside your program
For example: String s="ABCD"
Part 3: Extra Credit
Draw 4 rectangles in your Applet window to represent the percentages in part 2
Jing's demo
Here is Dori Smith's sample code to draw colorful rectangle in a Java Applet.
Note: I use number in my demo. But in your assignment, you should use percentage, which is almost the same as what I did.
Back to assignments index page