Question: C++ Main Program Flow: In main.cpp, write code that prompts user to enter 1 for Get GC Content, or 2 for Get DNA Complement. The
C++
Main Program Flow: In main.cpp, write code that prompts user to enter 1 for Get GC Content, or 2 for Get DNA Complement. The program will prompt user for a DNA string and call either get gc content or get dna complement function and display the result. Program runs as long as user enters a y or Y.
FILE: dna.h 1. /* Write prototype for function get_gc_content that accepts a const reference string parameter and returns a double */ 2. /* Write prototype for function get_reverse_string that accepts a string parameter and returns a string */ 3. /* Write prototype for function get_dna_complement that accepts a string and returns a string */
FILE: dna.cpp
4. /* Write code for function get_gc_content that accepts a const reference string parameter and returns a double. Calculate GC content: Iterate string count Gs and Cs, divide count by string length. Return quotient. */
#include "dna.h"
5. /* Write code for function get_reverse_string that accepts a string parameter and returns a string reversed. */
6. /* Write prototype for function get_dna_complement that accepts a string dna and returns a string. Calculate dna complement: a. call function get_reverse_string(dna), save results to a local string variable b. iterate local string variable and replace A with T, T with A, C with G and G with C c. return string */
FILE: main.cpp
7. /* Write code that prompts user to enter 1 for Get GC Content, or 2 for Get DNA Complement. The program will prompt user for a DNA string and call either get gc content or get dna complement function and display the result. Program runs as long as user enters a y or Y. */
int main() {
return 0;
}
Function specifications
| Function name | Parameters | Return Type |
| get_gc_content | const string& dna | double |
| get_dna_complement | string dna | string |
| reverse_string | string dna | string |
Test Cases
Test function get_gc_content(string dna)
| Value | Result |
| AGCTATAG | .375 |
| CGCTATAG | .50 |
Test function get_reverse_string(string dna)
| Value | Result |
| AGCTATAG | GATATCGA |
| CGCTATAG | GATATCGC |
Test get dna complement
| Value | Result |
| AAAACCCGGT | ACCGGGTTTT |
| CCCGGAAAAT | ATTTTCCGGG |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
