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”.
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”.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps