Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ DATA STRUCTURES 1. A string is a lot like a vector (or resizable array) of characters Imagine that strings do not exist in C++,

C++ DATA STRUCTURES

image text in transcribed

1. A string is a lot like a vector (or resizable array) of characters Imagine that strings do not exist in C++, and you have to create them. You would need to: Define a suitable class or struct for representing a string of characters, realising that strings can have any length whatsoever, from zero up Define a constructor that sets up an initially empty string C. Create a method that allows a single character to be added to the end of one of your strings Create a method that allows one string to be added to the end of another Create a function that will compare two strings to tell you whether they are the same, ignoring the difference between capital and little letters (so that "CAT" is considered to be the same as "cat") Do those things As an aid to understanding, here is a possible use of your creations MyString one, two, three; one.add'c); one.add('a) two.add( C; two.add( 'A; two.add( T one.add('t'); three.add (two); three.add(-); three.add (one); three.add (two); if (same(one, two)) cout

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

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions

Question

b. What groups were most represented? Why do you think this is so?

Answered: 1 week ago