One of the key features of Java OOP is to use external class files without knowing much of the implementations. The attached RandomSeq.class file contains the implementation of a RandomSeq class which contain two methods:
String RandomSeq.getRandomSeq(long arg0) -will return a String of randomly generated DNA sequence of any length passed in as a parameter, and
void RandomSeq.formatSeq(int arg0) – will print out a formatted DNA sequence with specified length for each line as shown below:
1 GACTTGCCAGTTTAATAATGTCACATAATCAGATACGTAGATTCGCTTAT
51 ATGCCCGGCCCACTGACGGAGGGGCCCGGGGGTCCAGCCCATGGGGCAGA
101 GGGACACTCTGAACGCTCGCGCAGGTACGTGTGGTAAACCGATATCGCGC
151 TTCTACTGACTCTCCCACTCAACGAAGACAAGACTTTGGCCACTCACCCG
201 GCATTACTATAGCTCGGTGCAGGGAGTCCTCAGCCCCGCGATGGATATTA
251 GGCTGGCCCCTAACCTGCGAGGACATTCAAAGTAGGTTTTGACCGGCATT
301 GCAAGGTCACTGAGGAGAATTTATGATAGCCGCCCATACC
The RandomSeq class also has two properties (id and seq) which has the set/get methods of setSeqID(String arg0), setSeq(String arg0), and getSeqID(), getSeq().
Please note, when a DNA sequence String was generated using the getRandomSeq() method, the sequence need to be assigned to the object using the setSeq(String arg0) method. After that, the formatSeq() method can be used to print out the formatted sequence.
Please create a testing Java program to use this RandomSeq class to create a random DNA sequence and then print it out in a formatted fashion with a specified length for each line.
Note: if you use NotePad to create your project, you can simply copy the RandomSeq.class attached file into the same folder of your testing Java program. If you use Eclipse or NetBeans, you probably need to create an external class folder for your project and then import the RandomSeq.class file into the class folder.
Here is how to add the RandomSeq.class file to your project in NetBeans and Eclipse: (assume the RandomSeq.class file is saved into C:BIFS618)
NetBeans: Create the project first, and then right click on the Libraries from the Projects window, and select Add JAR/Folder to open the window. Browse to the folder contains the .class file (c:BIFS618), click open. Now the folder is added to the Libraries, and you can create a RandomSeq object directly in your project.
Eclipse: Create the project first, and then right click on the project to select properties. In the properties window, select Libraries tab, and click on Add External Class Folder to select the folder contains the RandomSeq class file and click OK. Now you can use the RandomSeq class directly in your project.
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more