Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

Often, DNA sequences are represented as a sequence of characters (String) and each character in the sequence corresponds with one of four nucleotides.

A = adenine, C = cytosine, G = guanine, T = thymine

In this homework, we will work with DNA sequences and develop a program that allows the user to input an arbitrary DNA sequence and then retrieve additional information about the sequence.

Your assignment is to implement a program that does the following:

1. Ask the user for the DNA sequence

2. Validate the sequence

a. Invalid sequences contain characters other than A,C,G, or T.

b. If it is an invalid sequence, request another

3. Display a menu containing the different things we can do with this sequence.

a. Count the number of times a specific character occurs in the DNA sequence

i. The user will input the character they are interested in.

ii. You will print out the number of occurrences for that character.

b. Count the number of a pair of characters in the DNA sequence

i. The user will input the characters they are interested in.

ii. You will print out the number of occurrences for that pair of characters.

c.       Create the RNA sequence from the DNA sequence input by the user.

 i. The RNA sequence is the DNA sequence with all of the T's replaced with U's.

d. Create the complement of the DNA sequence.

i. There are two steps necessary to compute the complement of a DNA sequence

1. Reverse the DNA sequence

2. Replace all A's with T's, all T's with A's, all G's with C's, and All C's replaced with G's.

e. Quit

You will lose points if you do not create any methods other than the main method.  (Hint: The code for each menu item (other than Quit) should be its own method) Look at the Java String API for methods to help complete your tasks.

Sample Trace

> Please enter the DNA sequence:

GATCAGCCGC

> Please select from the following:

>     1. Count a character.

>     2. Count a pair of characters.

>     3. Convert the DNA to RNA.

>     4. Compute the complement.

>     5. Quit

1

> Please enter the character:

C

> The number of C's in the DNA sequence is 4

> Please select from the following:

>     1. Count a character.

>     2. Count a pair of characters.

>     3. Convert the DNA to RNA.

>     4. Compute the complement.

>     5. Quit

2

> Please enter the characters:

GC

> The number of GC's in the DNA sequence is 2

> Please select from the following:

>     1. Count a character.

>     2. Count a pair of characters.

>     3. Convert the DNA to RNA.

>     4. Compute the complement.

>     5. Quit

3

> The RNA sequence is GAUCAGCCGC

> Please select from the following:

>     1. Count a character.

>     2. Count a pair of characters.

>     3. Convert the DNA to RNA.

>     4. Compute the complement.

>     5. Quit

4

> The complement for the DNA sequence is GCGGCTGATC

> Please select from the following:

>     1. Count a character.

>     2. Count a pair of characters.

>     3. Convert the DNA to RNA.

>     4. Compute the complement.

>     5. Quit

5

> Goodbye!

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M9523416

Have any Question?


Related Questions in Programming Language

Task arrays and structsoverviewin this task you will

Task: Arrays and Structs Overview In this task you will continue to work on the knight database to help Camelot keep track of all of their knights. We can now add a kingdom struct to help work with and manage all of the ...

Assignment task -q1 a the fibonacci numbers are the numbers

Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the ...

Task working with arraysoverviewin this task you will

Task: Working with Arrays Overview In this task you will create a simple program which will create and work with an array of strings. This array will then be populated with values, printed out to the console, and then, w ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Question 1 what is a computer program what is structured

Question: 1. What is a Computer program? What is structured programming? 2. What is modular programming? Why we use it? 3. Please evaluate Sin (x) by infinite series. Then write an algorithm to implement it with up to th ...

Php amp session managment assignment -this assignment looks

PHP & SESSION MANAGMENT ASSIGNMENT - This assignment looks at using PHP for creating cookies and session management. Class Exercise - Web Project: Member Registration/Login This exercise will cover adding data connectivi ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As