Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write in java code The main method should go as follows: * 1. You ask the user f

ID: 3693085 • Letter: W

Question

write in java code

The main method should go as follows: * 1. You ask the user for a file name * 2. You read the file and retrieve information about DNAsequences by calling method ReadSequencesFromFile * 3. You ask the user for a file name * 4. You read the file and retrieve information about target strings by calling method ReadTargetsFromFile * 5. You run the relevant class methods from DNAsequence to fill the attributes. * 6. You sort the array obtained in Step 2 using method SortByBestOccurrenceAverage and print it out. * 7. You sort the array obtained in Step 6 using method SortByLetter where the letter is A, and print it out. * 8. You sort the array obtained in Step 7 using method SortByLetter where the letter is C, and print it out. * 9. You sort the array obtained in Step 8 using method SortByLetter where the letter is G, and print it out. * 10. You sort the array obtained in Step 9 using method SortByLetter where the letter is T, and print it out. public static void main(String[] args) throws IOException {

Explanation / Answer

//This program takes the name of the file from the user
//Assume the file from the same directory
//Askfile.java
import java.io.*;
import java.util.*;
public class Askfile
{
public static void main(String args[]) throws IOException
{
int c;
int lines=0;
   System.out.println("Enter the file name...");
   Scanner sc=new Scanner(System.in);
  
   String file=sc.next();
  
   File f = new File(file);
   FileInputStream fis = new FileInputStream(f);
while((c=fis.read())!=-1)
    {
   System.out.print((char)c);
   }
      
}
}