menu
bartleby
search
close search
Hit Return to see all results

Develop pseudocode for the problem of reading in an arbitrary number of DNA (deoxyribonucleic acid) bases, one at a time, and print out the complementary base sequence in the same order as the DNA bases were input.  There are four DNA bases:  A (adenine), C (cytosine), G (guanine), T (thymine).  You should verify that a correct base is input each time and print out an error message if it is incorrect.  Assume that “!” is used as the input symbol to indicate that no more DNA bases will be entered (i.e., it is the end of the DNA base sequence).  The following table shows the complementary base for each DNA base:DNA BaseComplementary BaseATCGGCTA As an example, if the input is “ATGGTCA”, then the output should be “TACCAGT”.

Question

Develop pseudocode for the problem of reading in an arbitrary number of DNA (deoxyribonucleic acid) bases, one at a time, and print out the complementary base sequence in the same order as the DNA bases were input.  There are four DNA bases:  A (adenine), C (cytosine), G (guanine), T (thymine).  You should verify that a correct base is input each time and print out an error message if it is incorrect.  Assume that “!” is used as the input symbol to indicate that no more DNA bases will be entered (i.e., it is the end of the DNA base sequence).  The following table shows the complementary base for each DNA base:

DNA Base

Complementary Base

A

T

C

G

G

C

T

A

 

As an example, if the input is “ATGGTCA”, then the output should be “TACCAGT”.

check_circleAnswer
Step 1

Pseudocode

  1. Create a dictionary data structure to store the DNA base and the complementary base as series of key value pairs
  2. Store the key value pairs in the dictionary
  3. Read the first input from console
  4. While(input is not equal to ‘!’){
    1. If the input read is valid then
      1. Find the complementary base of the i...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Our solutions are written by experts, many with advanced degrees, and available 24/7

See Solution
Tagged in

Engineering

Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you

Show more Q&A add
question_answer

Q: What are the errors in the following code?

A: Given below are the errors found in the code send by you along with an error free code.

question_answer

Q: C++ my programming lab 11.7: Customer AccountsWrite a program that uses a structure to store the fol...

A: Solution:Given data,The C++ code use 20 structures to get the user data, change account information,...

question_answer

Q: What would the output be when the user taps or clicks the btnDrivingAge button   Private Sub btnDri...

A: Form1:

question_answer

Q: a. Assuming that x is 1, show the result of the following Boolean expressions.(true) && (3 &...

A: Hey, since there are multiple sub-part posted, we will answer first three sub-part. If you want any ...

question_answer

Q: This code is for python

A: This is a very long problem because of lack of space we provide only a portion of the algorithm. How...

question_answer

Q: how to write a function that takes an integer n and prints all of the integers between 1 and n which...

A: Since no programming language is specified we choose python as it is one of most popular programming...

question_answer

Q: Create a new file in c++ and save it as lab11_XYZ.cpp (replace XYZ with your initials). Create ANOTH...

A: Program Instructions:In the header file, create a temporary variable temp of the data type of each v...

question_answer

Q: Eliminate all useless productions from the grammar S → aS|AB|λ, A → bA, B → AA. What language does t...

A: A useless production is basically a production which can never participate in the derivation of any ...

question_answer

Q: Cell Phones Records In this part, you are required to write a program, using linked lists, that man...

A: In the given question, some parts of the question are missing to use linked lists.Here, I have creat...

Sorry about that. What wasn’t helpful?