Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you please help me with this it's for C++ ! Will give thumbs up! ******* SAMPLE.CPP FILE IS BELOW!!!!! ********* ************************************** SAMPLE.CPP FILE BELOW

Can you please help me with this it's for C++ ! Will give thumbs up! ******* SAMPLE.CPP FILE IS BELOW!!!!! *********

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

************************************** SAMPLE.CPP FILE BELOW **********************************************

#include

#include "MyString.h"

using namespace std;

int main(){

//(1)

cout

MyString ms_default;

//(2)

cout

MyString ms_parametrized("MyString parametrized constructor!");

//(3)

cout

MyString ms_copy(ms_parametrized);

//(4)

cout

delete expressions"

MyString* ms_Pt = new MyString("MyString to be deleted

");

delete ms_Pt;

ms_Pt = NULL;

//(5),(6)

cout

MyString ms_size_length("Size and length test");

cout

cout

//(7)

cout

MyString ms_toCstring("C-String equivalent successfully obtained!");

cout

//(8)

cout

MyString ms_same1("The same"), ms_same2("The same");

if (ms_same1==ms_same2)

cout

MyString ms_different("The same (NOT)");

if (!(ms_same1==ms_different))

cout

//(9)

cout

MyString ms_assign("MyString before assignment");

cout

ms_assign = MyString("MyString after performing assignment");

cout

//(10)

cout

MyString ms_append1("The first part");

MyString ms_append2(" and the second");

MyString ms_concat = ms_append1+ ms_append2;

cout

//(11)

cout

MyString ms_access("Access successful (NOT)");

ms_access[17] = 0;

//(12)

cout

}

Objectives: The main objectives of this project are to test your ability to create and use dynamic Description: For this project you will create your own String class. You may use square bracket-indexing. pointers, references, all operators, as well as the or library functions (however the std::string type is still not allowed) The following header file extract gives the required specifications for the class //Necessary preprocessor #define (s) //Necessary include(s) //You can include or //class specification class Mystringt public MyString) Mystring (const char str)i MyString (const Mystring& other)i MyString); 17(2) 1/(3)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions