Question: This assignment is done in C++. A header file is provided. It should not be modified. #ifndef DNAStrand_H #define DNAStrand_H #include class DNAStrand { public:

This assignment is done in C++. A header file is provided. It should not be modified.

This assignment is done in C++. A header file is provided. It

should not be modified. #ifndef DNAStrand_H #define DNAStrand_H #include class DNAStrand {

public: /** * @brief DNAStrand Builds a DNAStrand using the given C-String

* @param startingString A null terminated char array * * Throws a

#ifndef DNAStrand_H #define DNAStrand_H #include  class DNAStrand { public: /** * @brief DNAStrand Builds a DNAStrand using the given C-String * @param startingString A null terminated char array * * Throws a logic_error exception if the startingString contains anything but A, C, G, or T */ DNAStrand(const char* startingString); /** * @brief DNAStrand Copy Ctor * @param other DNAStrand to copy */ DNAStrand(const DNAStrand& other); /** * @brief operator = Assignment Operator for DNAStrand * @param other DNAStrand to duplicate * @return Reference to the string that was copied into */ DNAStrand& operator=(const DNAStrand& other); /** * @brief Destructor */ ~DNAStrand(); /** * @brief operator == Check if two DNAStrands have same contents * @param other DNAStrand to compate to * @return true if identical, false if not */ bool operator==(const DNAStrand& other) const; /** * @brief operator [] Access individual nucleotide from DNAStrand * @param index location to access * @return char value at index. Not returned by referece - no write access * * Throws an out_of_range exception if the index is less than 0 or too large */ char operator[](int index) const; /** * @brief operator + Combine two DNAStrands * @param other DNAStrand to merge with this * @return DNAStrand with contents of current DNAStrand followed by contents of other */ DNAStrand operator+(const DNAStrand& other) const; //Declare as friend... declared after class friend std::ostream& operator 

logic_error exception if the startingString contains anything but A, C, G, or

Your task is to make a class that represent a DNA strand. A DNAStrand will track its length and a character array to store the bases (which will be stored as A, C, G, or T). We will normally create a DNAStrand by doing something like: DNAStrand strand1("ACTGAGATA"); DNAStrand will also provide various operators and functions for doing things like combining two strands, getting the complement of a strand or searching for one strand inside another. DNAStrand substr(int start, int length) const - Get a new DNAStrand that contains the indicated portion of this DNAStrand. You will probably need/want the DNAString(int length) constructor as a helper for this. This should throw an out_of_range exception if the index or length are negative, or if the start + length would go past the end of the strand. Remember: you may NOT use std::string in this project. You can use functions from the cstring library. Your task is to make a class that represent a DNA strand. A DNAStrand will track its length and a character array to store the bases (which will be stored as A, C, G, or T). We will normally create a DNAStrand by doing something like: DNAStrand strand1("ACTGAGATA"); DNAStrand will also provide various operators and functions for doing things like combining two strands, getting the complement of a strand or searching for one strand inside another. DNAStrand substr(int start, int length) const - Get a new DNAStrand that contains the indicated portion of this DNAStrand. You will probably need/want the DNAString(int length) constructor as a helper for this. This should throw an out_of_range exception if the index or length are negative, or if the start + length would go past the end of the strand. Remember: you may NOT use std::string in this project. You can use functions from the cstring library

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 Databases Questions!