Use arrays to store data for analysis Use functions to perfo

Use arrays to store data for analysis. Use functions to perform the analysis described below. All output is to be written to an output file.

Solution

import java.util.Scanner;
import java.util.ArrayList;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.ArrayList;


public class DNA{

   private String dna;

   public DNA(){

   }

   public void read_store(String filename){
       /*try {
           Scanner in;
           //in = new Scanner(new FileReader(filename));
           dna = in.next();
              
         
   }catch(IOException e){
       System.out.println(\"file not there \" + e);
       return;
   }*/

   }

   public char compliment_base(char c){

       if(c == \'A\') return \'T\';
       if(c == \'T\') return \'A\';
       if(c == \'G\') return \'C\';
       if(c == \'C\') return \'G\';

       return \' \';
   }

   public void DrawDNA(String seq){

       System.out.println(\"---+-----+------+------+------\");

       for (char c : seq.toCharArray() ) {
          
           System.out.print(c + \" \");
          
       }


       System.out.println(\"DNA Sequence \");

       System.out.println(\"................................\");

       for (char c : seq.toCharArray() ) {
          
           System.out.print(compliment_base(c) + \" \");
          
       }

       System.out.println(\" Complement \");

       System.out.println(\"---+-----+------+------+------\");

       System.out.println(\"\");
   }

   public void Prefix(int n, String base){

       String output = base.substring(0,n);

       DrawDNA(output);
   }

   public static void main(String[] args) {

      DNA d = new DNA();

      d.DrawDNA(\"ATGC\");

      d.Prefix(4,\"ACGTTGCA\");
      
   }


}

---+-----+------+------+------
A T G C DNA Sequence
................................
T A C G Complement
---+-----+------+------+------

---+-----+------+------+------
A C G T DNA Sequence
................................
T G C A Complement
---+-----+------+------+------

Use arrays to store data for analysis. Use functions to perform the analysis described below. All output is to be written to an output file.Solutionimport java.
Use arrays to store data for analysis. Use functions to perform the analysis described below. All output is to be written to an output file.Solutionimport java.

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site