Question: 1 . Write a C + + function to check that the DNA string entered using Part I is valid i . e . the

1. Write a C++ function to check that the DNA string entered using Part I is valid i.e. the string only
contains valid nucleotides (A|G|T|C). These can be repeated any amount of time, but can only be
these characters. There should also be no white spaces in the entered text.
2. The function should accept the original string variable (from Part I) as an argument (passed by val-
ue) and should return true/false as the result (true if valid). The function prototype should be:
bool checkValidity(string s);
3. The output to the screen should extend the output of Part I (as in the following examples):
ABHDKDJ (7 chars) : INVALID DNA
AGTC (4 chars) : VALID DNA
AgtCCcTa (8 chars) : VALID DNA

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!