Question: 1 . Write a C + + function that allows the user to enter a string of characters ( which may or may not rep

1. Write a C++ function that allows the user to enter a string of characters (which may or may not rep-
resent a valid DNA string). Upon pressing the string should be read from standard input
(cin) and returned by the function.
2. You should assume that main() calls the function, passing no args. The return type of the function
should be string. The function prototype should be like:
string enterDNAString();
3. The program should echo the string entered, followed by the size of the string (number of charac-
ters) in brackets, for e.g. if the user enters ABHDKDJ, the program will output:
ABHDKDJ (7 chars)

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!