SlideShare a Scribd company logo
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
---+-----+------+------+------

More Related Content

Similar to Use arrays to store data for analysis. Use functions to perform the .pdf

We will be making 4 classes Main - for testing the code Hi.pdf
 We will be making 4 classes Main - for testing the code Hi.pdf We will be making 4 classes Main - for testing the code Hi.pdf
We will be making 4 classes Main - for testing the code Hi.pdf
anithareadymade
 
stateDatabuild.xml Builds, tests, and runs the project.docx
stateDatabuild.xml      Builds, tests, and runs the project.docxstateDatabuild.xml      Builds, tests, and runs the project.docx
stateDatabuild.xml Builds, tests, and runs the project.docx
whitneyleman54422
 
Main class --------------------------import java.awt.FlowLayout.pdf
Main class --------------------------import java.awt.FlowLayout.pdfMain class --------------------------import java.awt.FlowLayout.pdf
Main class --------------------------import java.awt.FlowLayout.pdf
anushkaent7
 
Soundreader.classpathSoundreader.project Soundre.docx
Soundreader.classpathSoundreader.project  Soundre.docxSoundreader.classpathSoundreader.project  Soundre.docx
Soundreader.classpathSoundreader.project Soundre.docx
whitneyleman54422
 
(JAVA NetBeans) Write a Java program able to perform selection sort-So.docx
(JAVA NetBeans) Write a Java program able to perform selection sort-So.docx(JAVA NetBeans) Write a Java program able to perform selection sort-So.docx
(JAVA NetBeans) Write a Java program able to perform selection sort-So.docx
dorisc7
 
Java Program I keep receiving the following error in my code- Can you.pdf
Java Program I keep receiving the following error in my code- Can you.pdfJava Program I keep receiving the following error in my code- Can you.pdf
Java Program I keep receiving the following error in my code- Can you.pdf
RyanF2PLeev
 
Java Programs
Java ProgramsJava Programs
Java Programs
vvpadhu
 
I can not get my code to comply it gets mad that I have run declare mo.docx
I can not get my code to comply it gets mad that I have run declare mo.docxI can not get my code to comply it gets mad that I have run declare mo.docx
I can not get my code to comply it gets mad that I have run declare mo.docx
hamblymarta
 
srgoc
srgocsrgoc
Write a program in Java that reads a set of doubles from a file, sto.pdf
Write a program in Java that reads a set of doubles from a file, sto.pdfWrite a program in Java that reads a set of doubles from a file, sto.pdf
Write a program in Java that reads a set of doubles from a file, sto.pdf
arihantpatna
 
Java căn bản - Chapter12
Java căn bản - Chapter12Java căn bản - Chapter12
Java căn bản - Chapter12Vince Vo
 
Chapter 12 - File Input and Output
Chapter 12 - File Input and OutputChapter 12 - File Input and Output
Chapter 12 - File Input and Output
Eduardo Bergavera
 
Important java programs(collection+file)
Important java programs(collection+file)Important java programs(collection+file)
Important java programs(collection+file)Alok Kumar
 
Lab4
Lab4Lab4
The Java Program for the above given isimport java.io.File;impo.pdf
The Java Program for the above given isimport java.io.File;impo.pdfThe Java Program for the above given isimport java.io.File;impo.pdf
The Java Program for the above given isimport java.io.File;impo.pdf
anjanacottonmills
 
File Handling.pptx
File Handling.pptxFile Handling.pptx
File Handling.pptx
PragatiSutar4
 
In java , I want you to implement a Data Structure known as a Doubly.pdf
In java , I want you to implement a Data Structure known as a Doubly.pdfIn java , I want you to implement a Data Structure known as a Doubly.pdf
In java , I want you to implement a Data Structure known as a Doubly.pdf
aromalcom
 
IN JAVA Write a program to create a binary data file named RandomInt.pdf
IN JAVA Write a program to create a binary data file named RandomInt.pdfIN JAVA Write a program to create a binary data file named RandomInt.pdf
IN JAVA Write a program to create a binary data file named RandomInt.pdf
herminaherman
 

Similar to Use arrays to store data for analysis. Use functions to perform the .pdf (20)

We will be making 4 classes Main - for testing the code Hi.pdf
 We will be making 4 classes Main - for testing the code Hi.pdf We will be making 4 classes Main - for testing the code Hi.pdf
We will be making 4 classes Main - for testing the code Hi.pdf
 
stateDatabuild.xml Builds, tests, and runs the project.docx
stateDatabuild.xml      Builds, tests, and runs the project.docxstateDatabuild.xml      Builds, tests, and runs the project.docx
stateDatabuild.xml Builds, tests, and runs the project.docx
 
Main class --------------------------import java.awt.FlowLayout.pdf
Main class --------------------------import java.awt.FlowLayout.pdfMain class --------------------------import java.awt.FlowLayout.pdf
Main class --------------------------import java.awt.FlowLayout.pdf
 
Soundreader.classpathSoundreader.project Soundre.docx
Soundreader.classpathSoundreader.project  Soundre.docxSoundreader.classpathSoundreader.project  Soundre.docx
Soundreader.classpathSoundreader.project Soundre.docx
 
(JAVA NetBeans) Write a Java program able to perform selection sort-So.docx
(JAVA NetBeans) Write a Java program able to perform selection sort-So.docx(JAVA NetBeans) Write a Java program able to perform selection sort-So.docx
(JAVA NetBeans) Write a Java program able to perform selection sort-So.docx
 
Java Program I keep receiving the following error in my code- Can you.pdf
Java Program I keep receiving the following error in my code- Can you.pdfJava Program I keep receiving the following error in my code- Can you.pdf
Java Program I keep receiving the following error in my code- Can you.pdf
 
Java Programs
Java ProgramsJava Programs
Java Programs
 
I can not get my code to comply it gets mad that I have run declare mo.docx
I can not get my code to comply it gets mad that I have run declare mo.docxI can not get my code to comply it gets mad that I have run declare mo.docx
I can not get my code to comply it gets mad that I have run declare mo.docx
 
srgoc
srgocsrgoc
srgoc
 
Write a program in Java that reads a set of doubles from a file, sto.pdf
Write a program in Java that reads a set of doubles from a file, sto.pdfWrite a program in Java that reads a set of doubles from a file, sto.pdf
Write a program in Java that reads a set of doubles from a file, sto.pdf
 
Java căn bản - Chapter12
Java căn bản - Chapter12Java căn bản - Chapter12
Java căn bản - Chapter12
 
Chapter 12 - File Input and Output
Chapter 12 - File Input and OutputChapter 12 - File Input and Output
Chapter 12 - File Input and Output
 
Core java
Core javaCore java
Core java
 
Important java programs(collection+file)
Important java programs(collection+file)Important java programs(collection+file)
Important java programs(collection+file)
 
Lab4
Lab4Lab4
Lab4
 
The Java Program for the above given isimport java.io.File;impo.pdf
The Java Program for the above given isimport java.io.File;impo.pdfThe Java Program for the above given isimport java.io.File;impo.pdf
The Java Program for the above given isimport java.io.File;impo.pdf
 
Files io
Files ioFiles io
Files io
 
File Handling.pptx
File Handling.pptxFile Handling.pptx
File Handling.pptx
 
In java , I want you to implement a Data Structure known as a Doubly.pdf
In java , I want you to implement a Data Structure known as a Doubly.pdfIn java , I want you to implement a Data Structure known as a Doubly.pdf
In java , I want you to implement a Data Structure known as a Doubly.pdf
 
IN JAVA Write a program to create a binary data file named RandomInt.pdf
IN JAVA Write a program to create a binary data file named RandomInt.pdfIN JAVA Write a program to create a binary data file named RandomInt.pdf
IN JAVA Write a program to create a binary data file named RandomInt.pdf
 

More from footworld1

Describe 3 functions of the cellular membrane and how are these func.pdf
Describe 3 functions of the cellular membrane and how are these func.pdfDescribe 3 functions of the cellular membrane and how are these func.pdf
Describe 3 functions of the cellular membrane and how are these func.pdf
footworld1
 
Discuss the three main types of intellectual capitalSolutionth.pdf
Discuss the three main types of intellectual capitalSolutionth.pdfDiscuss the three main types of intellectual capitalSolutionth.pdf
Discuss the three main types of intellectual capitalSolutionth.pdf
footworld1
 
Describer in detail the innate immune response to both an intercellu.pdf
Describer in detail the innate immune response to both an intercellu.pdfDescriber in detail the innate immune response to both an intercellu.pdf
Describer in detail the innate immune response to both an intercellu.pdf
footworld1
 
Describe the difference between tropic and non-tropic hormones.S.pdf
Describe the difference between tropic and non-tropic hormones.S.pdfDescribe the difference between tropic and non-tropic hormones.S.pdf
Describe the difference between tropic and non-tropic hormones.S.pdf
footworld1
 
C++ ProgrammingGivenWrite a closest Pair FunctionDeliverable.pdf
C++ ProgrammingGivenWrite a closest Pair FunctionDeliverable.pdfC++ ProgrammingGivenWrite a closest Pair FunctionDeliverable.pdf
C++ ProgrammingGivenWrite a closest Pair FunctionDeliverable.pdf
footworld1
 
Can someone explain to me what the learning curve equation (Tn=T1n^.pdf
Can someone explain to me what the learning curve equation (Tn=T1n^.pdfCan someone explain to me what the learning curve equation (Tn=T1n^.pdf
Can someone explain to me what the learning curve equation (Tn=T1n^.pdf
footworld1
 
Both influenza virus and (IFV), and Measles Virus (MV) are envel.pdf
Both influenza virus and (IFV), and Measles Virus (MV) are envel.pdfBoth influenza virus and (IFV), and Measles Virus (MV) are envel.pdf
Both influenza virus and (IFV), and Measles Virus (MV) are envel.pdf
footworld1
 
All of the following are characteristic to fatigue fracture surfaces.pdf
All of the following are characteristic to fatigue fracture surfaces.pdfAll of the following are characteristic to fatigue fracture surfaces.pdf
All of the following are characteristic to fatigue fracture surfaces.pdf
footworld1
 
A cancer biology topic Describte how ChIP (chromatin immunoprecipit.pdf
A cancer biology topic Describte how ChIP (chromatin immunoprecipit.pdfA cancer biology topic Describte how ChIP (chromatin immunoprecipit.pdf
A cancer biology topic Describte how ChIP (chromatin immunoprecipit.pdf
footworld1
 
You get a call from a customer who reinstalled Windows on his comput.pdf
You get a call from a customer who reinstalled Windows on his comput.pdfYou get a call from a customer who reinstalled Windows on his comput.pdf
You get a call from a customer who reinstalled Windows on his comput.pdf
footworld1
 
You are running the Windows installation setup for Windows 7 on a co.pdf
You are running the Windows installation setup for Windows 7 on a co.pdfYou are running the Windows installation setup for Windows 7 on a co.pdf
You are running the Windows installation setup for Windows 7 on a co.pdf
footworld1
 
Write a program to decipher messages encoded using a prefix code, gi.pdf
Write a program to decipher messages encoded using a prefix code, gi.pdfWrite a program to decipher messages encoded using a prefix code, gi.pdf
Write a program to decipher messages encoded using a prefix code, gi.pdf
footworld1
 
With the biological species concept, the process of speciation is fre.pdf
With the biological species concept, the process of speciation is fre.pdfWith the biological species concept, the process of speciation is fre.pdf
With the biological species concept, the process of speciation is fre.pdf
footworld1
 
Write a class ArrayList that represents an array of integers. Init.pdf
Write a class ArrayList that represents an array of integers. Init.pdfWrite a class ArrayList that represents an array of integers. Init.pdf
Write a class ArrayList that represents an array of integers. Init.pdf
footworld1
 
what is the relationship between lnx and 1xSolutionThe relat.pdf
what is the relationship between lnx and 1xSolutionThe relat.pdfwhat is the relationship between lnx and 1xSolutionThe relat.pdf
what is the relationship between lnx and 1xSolutionThe relat.pdf
footworld1
 
Which of these conclusions is supported by plant phylogenies (evolut.pdf
Which of these conclusions is supported by plant phylogenies (evolut.pdfWhich of these conclusions is supported by plant phylogenies (evolut.pdf
Which of these conclusions is supported by plant phylogenies (evolut.pdf
footworld1
 
Who are some other individuals who might want to use the informa.pdf
Who are some other individuals who might want to use the informa.pdfWho are some other individuals who might want to use the informa.pdf
Who are some other individuals who might want to use the informa.pdf
footworld1
 
Which account below is not a subdivision of owners equityAccumu.pdf
Which account below is not a subdivision of owners equityAccumu.pdfWhich account below is not a subdivision of owners equityAccumu.pdf
Which account below is not a subdivision of owners equityAccumu.pdf
footworld1
 
What is the nucleoid region of a prokaryotic cell a membrane bound .pdf
What is the nucleoid region of a prokaryotic cell  a membrane bound .pdfWhat is the nucleoid region of a prokaryotic cell  a membrane bound .pdf
What is the nucleoid region of a prokaryotic cell a membrane bound .pdf
footworld1
 
What is heartwood What is sapwood What is the most abundant tissu.pdf
What is heartwood  What is sapwood  What is the most abundant tissu.pdfWhat is heartwood  What is sapwood  What is the most abundant tissu.pdf
What is heartwood What is sapwood What is the most abundant tissu.pdf
footworld1
 

More from footworld1 (20)

Describe 3 functions of the cellular membrane and how are these func.pdf
Describe 3 functions of the cellular membrane and how are these func.pdfDescribe 3 functions of the cellular membrane and how are these func.pdf
Describe 3 functions of the cellular membrane and how are these func.pdf
 
Discuss the three main types of intellectual capitalSolutionth.pdf
Discuss the three main types of intellectual capitalSolutionth.pdfDiscuss the three main types of intellectual capitalSolutionth.pdf
Discuss the three main types of intellectual capitalSolutionth.pdf
 
Describer in detail the innate immune response to both an intercellu.pdf
Describer in detail the innate immune response to both an intercellu.pdfDescriber in detail the innate immune response to both an intercellu.pdf
Describer in detail the innate immune response to both an intercellu.pdf
 
Describe the difference between tropic and non-tropic hormones.S.pdf
Describe the difference between tropic and non-tropic hormones.S.pdfDescribe the difference between tropic and non-tropic hormones.S.pdf
Describe the difference between tropic and non-tropic hormones.S.pdf
 
C++ ProgrammingGivenWrite a closest Pair FunctionDeliverable.pdf
C++ ProgrammingGivenWrite a closest Pair FunctionDeliverable.pdfC++ ProgrammingGivenWrite a closest Pair FunctionDeliverable.pdf
C++ ProgrammingGivenWrite a closest Pair FunctionDeliverable.pdf
 
Can someone explain to me what the learning curve equation (Tn=T1n^.pdf
Can someone explain to me what the learning curve equation (Tn=T1n^.pdfCan someone explain to me what the learning curve equation (Tn=T1n^.pdf
Can someone explain to me what the learning curve equation (Tn=T1n^.pdf
 
Both influenza virus and (IFV), and Measles Virus (MV) are envel.pdf
Both influenza virus and (IFV), and Measles Virus (MV) are envel.pdfBoth influenza virus and (IFV), and Measles Virus (MV) are envel.pdf
Both influenza virus and (IFV), and Measles Virus (MV) are envel.pdf
 
All of the following are characteristic to fatigue fracture surfaces.pdf
All of the following are characteristic to fatigue fracture surfaces.pdfAll of the following are characteristic to fatigue fracture surfaces.pdf
All of the following are characteristic to fatigue fracture surfaces.pdf
 
A cancer biology topic Describte how ChIP (chromatin immunoprecipit.pdf
A cancer biology topic Describte how ChIP (chromatin immunoprecipit.pdfA cancer biology topic Describte how ChIP (chromatin immunoprecipit.pdf
A cancer biology topic Describte how ChIP (chromatin immunoprecipit.pdf
 
You get a call from a customer who reinstalled Windows on his comput.pdf
You get a call from a customer who reinstalled Windows on his comput.pdfYou get a call from a customer who reinstalled Windows on his comput.pdf
You get a call from a customer who reinstalled Windows on his comput.pdf
 
You are running the Windows installation setup for Windows 7 on a co.pdf
You are running the Windows installation setup for Windows 7 on a co.pdfYou are running the Windows installation setup for Windows 7 on a co.pdf
You are running the Windows installation setup for Windows 7 on a co.pdf
 
Write a program to decipher messages encoded using a prefix code, gi.pdf
Write a program to decipher messages encoded using a prefix code, gi.pdfWrite a program to decipher messages encoded using a prefix code, gi.pdf
Write a program to decipher messages encoded using a prefix code, gi.pdf
 
With the biological species concept, the process of speciation is fre.pdf
With the biological species concept, the process of speciation is fre.pdfWith the biological species concept, the process of speciation is fre.pdf
With the biological species concept, the process of speciation is fre.pdf
 
Write a class ArrayList that represents an array of integers. Init.pdf
Write a class ArrayList that represents an array of integers. Init.pdfWrite a class ArrayList that represents an array of integers. Init.pdf
Write a class ArrayList that represents an array of integers. Init.pdf
 
what is the relationship between lnx and 1xSolutionThe relat.pdf
what is the relationship between lnx and 1xSolutionThe relat.pdfwhat is the relationship between lnx and 1xSolutionThe relat.pdf
what is the relationship between lnx and 1xSolutionThe relat.pdf
 
Which of these conclusions is supported by plant phylogenies (evolut.pdf
Which of these conclusions is supported by plant phylogenies (evolut.pdfWhich of these conclusions is supported by plant phylogenies (evolut.pdf
Which of these conclusions is supported by plant phylogenies (evolut.pdf
 
Who are some other individuals who might want to use the informa.pdf
Who are some other individuals who might want to use the informa.pdfWho are some other individuals who might want to use the informa.pdf
Who are some other individuals who might want to use the informa.pdf
 
Which account below is not a subdivision of owners equityAccumu.pdf
Which account below is not a subdivision of owners equityAccumu.pdfWhich account below is not a subdivision of owners equityAccumu.pdf
Which account below is not a subdivision of owners equityAccumu.pdf
 
What is the nucleoid region of a prokaryotic cell a membrane bound .pdf
What is the nucleoid region of a prokaryotic cell  a membrane bound .pdfWhat is the nucleoid region of a prokaryotic cell  a membrane bound .pdf
What is the nucleoid region of a prokaryotic cell a membrane bound .pdf
 
What is heartwood What is sapwood What is the most abundant tissu.pdf
What is heartwood  What is sapwood  What is the most abundant tissu.pdfWhat is heartwood  What is sapwood  What is the most abundant tissu.pdf
What is heartwood What is sapwood What is the most abundant tissu.pdf
 

Recently uploaded

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 

Recently uploaded (20)

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 

Use arrays to store data for analysis. Use functions to perform the .pdf

  • 1. 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';
  • 2. 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
  • 3. ................................ T A C G Complement ---+-----+------+------+------ ---+-----+------+------+------ A C G T DNA Sequence ................................ T G C A Complement ---+-----+------+------+------