The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 5 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
Help me finish assignment 04 please and also write the muddiest point for this assignment too.
Assignment Four - Phase ThreeÂ
Objective
To gain experience with the dynamic data structures (allocation, automatic expansion, deletion) and the "big three" concepts: Destructors, Copy constructors, and Assignment operator.Â
Project Description
In last two assignments (phase I & phase II), we wrote a String class by using static array as the data member. The purpose of this assignment is to replace the static array by dynamic array. You are required to modify the String class accordingly:
Data:Â we wish to allow our String class to accommodate strings of different sizes. To that end, instead of storing a string's characters in a fixed-size array, each String object should contain the following data as part of its internal representation:
(1)Â a character pointer meant to point to a dynamically-allocated array of characters.
(2)Â a length field that will hold the current length of the string at any given moment.
Operations: same as the methods in String class - phase 2, plus the "big three"( destructor, copy constructor, and assignment operator overloading).
Modularity: The String class code must be put in its own module, i.e., a file mystring.h (the header file) should hold the class definition (use conditional compilation directives) and a file mystring.cpp (the implementation file) should hold the method definitions.Â
Note: In your implementation of String's methods, you may use the library functions provided by , which operate on the C style string. Our textbook contains good review about it page 212 to 214, and Appendix D 5. However, the difference with the last assignment is that you need to allocate memory first in the implementations of constructors. Almost all the implementations of overloading operators (except +=, and = ) should not be changed.Â
Download Test Driver: We provide a driver (file Assign4driver.cpp![]()
)Â that you can download and use to test your new class. You are not allowed to change it!
Upload your source code files (upload - do NOT zip them! - your two source files: mystring.h and mystring.cpp) for the assignment here.
Grading Policy
(30 points) Grading of this programming assignments will reflect two factors, weighted as shown.
Correctness -- Does the program run correctly and follow the requirements? (25 points)
Style -- Does the code follow the Documentation and Submission Guidelines? Is the code well structured, readable? Do you paste your output as the comment after the main function? (5 points )
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly