(Solved) : Required Functions Friend Dnasequence Operator Const Dnasequence Arg1 Const Dnasequence Ar Q42755525 . . .

Required functions:

  • friend DNASequence operator+(const DNASequence& arg1, constDNASequence& arg2);
  • friend DNASequence operator-(const DNASequence& arg1, constDNASequence& arg2);
  • friend istream& operator>>(istream& ins,DNASequence& arg);
  • friend ostream& operator<<<<(ostream& out,const DNASequence& arg);

Accessor functions get_max_sequence(),get_dna_sequence(),  get_num_sequences()

General Requirements

In this lab, you will be implementing the member and friendfunctions of a DNASequence class that is stubbed out for you indnasequence.h and dnasequence.cpp files. Below you will findinstructions for exactly what to implement. The point of the lab isto implement the Big Three: a destructor, a copy constructor and anassignment operator=. They are needed because of the dynamic arrayof characters in DNASequence. .

Also include the operator==, operator+ and operator-.

Specific Requirements:

a default constructor

a copy constructor

a constructor that takes a string value from which toinitialize

The class should implement the following as well:

  • a destructor that cleans up the dynamic memory allocation.
  • const accessor/mutator functions for max_length anddnasequence.
  • an assignment operator= as a member function.
  • the operator>> and operator<< as friendfunctions.
  • the operator+ returns a DNASequence with the second operandappended to the first operand.
  • the operator== to compare the DNASequences to see if they areequal. Only compare the character arrays, not max_length.
  • the operator!= to compare the DNASequences to see if they arenot equal.
    HINT: return !(a == b).
  • the operator- returns a DNASequence with the first occurance ofthe second operand removed from first operand.

Example Output:

Welcome to CRISPR!Enter the number of DNA sequences needed: Processing DNA sequence #1Enter the elements in sequence #1Processing DNA sequence #2Enter the elements in sequence #2The contents in the big strand is: ATTGGGGCCTTChecking == operator … Functioning properlyChecking != operator… Functioning properlyEnter a bad DNASequence to remove from big_strand: clean_strand[ATTGGGGCCTT] != big_strand[ATTGGGGCCTT]The contents in the clean strand is: ATTGGGGCCTTWould you like to try again (y/n)?Enter the number of DNA sequences needed: Processing DNA sequence #1Enter the elements in sequence #1Processing DNA sequence #2Enter the elements in sequence #2Processing DNA sequence #3Enter the elements in sequence #3The contents in the big strand is: ATTGGTGGTCCGGTGGTGCCAATGTGChecking == operator … Functioning properlyChecking != operator… Functioning properlyEnter a bad DNASequence to remove from big_strand: clean_strand[ATTGGTCCGGTGGTGCCAATGTG] != big_strand[ATTGGTGGTCCGGTGGTGCCAATGTG]clean_strand[ATTGGTCCGGTGCCAATGTG] != big_strand[ATTGGTCCGGTGGTGCCAATGTG]clean_strand[ATTGGTCCGCCAATGTG] != big_strand[ATTGGTCCGGTGCCAATGTG]clean_strand[ATTGGTCCGCCAAT] != big_strand[ATTGGTCCGCCAATGTG]clean_strand[ATTGGTCCGCCAAT] != big_strand[ATTGGTCCGCCAAT]The contents in the clean strand is: ATTGGTCCGCCAATWould you like to try again (y/n)?Have a nice day!

Expert Answer


Answer to Required functions: friend DNASequence operator+(const DNASequence& arg1, const DNASequence& arg2); friend DNASequence …

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us