Related questions
C++
Please help me complete the DynamicStringArray.cpp.
I pasted the codes that you need to complete it. Below is DynamicStringArray.h,DynamicStringArray.cpp, and the main.cpp. Please help me.
below code is DynamicStringArray.h:
//***********************************************//
// Please do not change the this file !!!!!
//***********************************************//
#ifndef DYNAMICSTRINGARRAY _H
#define DYNAMICSTRINGARRAY _H
#include <iostream>
#include <string>
using namespace std;
class DynamicStringArray
{
public:
DynamicStringArray();
int sizeIs();
string* getDynamicArray ();
void addEntry (string);
bool deleteEntry (string);
string* getEntry(int );
~DynamicStringArray ();
void printDynamicArray();
private:
string *dynamicArray;
int size;
};
#endif // DYNAMICSTRINGARRAY _H
BELOW IS MAIN.CPP
//***********************************************//
// Do not change the this main program !!!!!
//***********************************************//
#include "DynamicStringArray .h"
#include <iostream>
#include <string>
using namespace std;
int main()
{
int op;
string str;
DynamicStringArray List; //DynamicStringArray=NULL size=0
cout<<"------>>> choose an option from the menu <<<------"<<endl;
cout<<" 1.Add an entry to the list of string........"<<endl;
cout<<" 2.Delete an entry to the list of string....."<<endl;
cout<<" 3.Display the list entries.................."<<endl;
cout<<" 4.End Program..............................."<<endl;
do{
cout<<"\n >> Enter your option from the menu:";
cin>>op;
if(op<=0 || op>5) {
cout<<"Wrong choice. Try again!!"<<endl;
continue;
}
switch(op){
case 1:
cout<<" >>> Enter a string to add to the list: ";
cin>> str;
List.addEntry (str);
break;
case 2:
cout<<" >>> Enter a string to remove from the list: ";
cin>> str;
List.deleteEntry(str);
break;
case 3:
List.printDynamicArray();
break;
case 4:
break;
}
} while(op!=4);
cout<<"End of Program.Bye!";
return 0;
}
Below is the code i have to change:
// Write the implementation of every method of the class
// DynamicStringArray defined in DynamicStringArray.h
#include "DynamicStringArray .h"
//default constructor
DynamicStringArray ::DynamicStringArray (){
//write code body of DynamicStringArray ()
}
int DynamicStringArray ::sizeIs(){
//write code body of sizeIs ()
}
void DynamicStringArray ::addEntry (string str){
//write code body of addEntry ()
};
bool DynamicStringArray::deleteEntry (string str){
//write code body of deleteEntry ()
}
string* DynamicStringArray::getEntry(int index){
//write code body of deleteEntry ()
}
//destructor
DynamicStringArray ::~DynamicStringArray (){
//write code body of ~DynamicStringArray ()
}
void DynamicStringArray ::printDynamicArray(){
//write code body of printDynamicArray ()
}
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
- PLEASE COMMENT CODE In a python program, create a new file and call it " tracking". Write to it four lines each contains information about an order like this: 1-00654-021 Dell charger Toronto-WEST 99-49-ZAD011-76540-022 ASUS battery Milton-EAST 34-56-CBH561-09239-026 HP HD Scarborough-NORTH 12-98-AZC451-12349-029 Mac FD North York-LAWRENCE 34-49-ZWL01Add the file two more lines: 1-34567-055 Lenovo SSD Milton-ON 34-09-MT04 1-90432-091 Lenovo battery Oakville-ON 78-KL98 Define a function that searches for a brand (e.g. Dell, ASUS, etc.). Test the function in your program.arrow_forwardPlease convert this C++ code to Java code. REMINDER: The output MUST match the picture.arrow_forwardc++arrow_forward
- Program in C++ & Visual Studio not Studio Code Everyone has played Yahtzee... Right? There are so many better dice games, but my family likes this one the best. A YouTube video that describes Yahtzee can be found here. The basic rules are as follows: At the start of your turn you roll five normal everyday six sided dice. In the course of your turn you would choose to reroll any of the dice up to two more times. We are more concerned in this problem with the dice at the completion of your turn. This website gives a great rundown of the probabilities of Yahtzee that you will need. NOTE: You may ONLY use a set and map data structure to complete the solution to this problem Let’s see what results the dice give us using the following data structures and process: Prompt the user to enter five valid numbers (Range: One to six inclusive on both ends) Each time the user enters a valid number, "place" it into a map of integersCreate and use a set of integers with your data to...arrow_forwardPlease help me with these question. I am having trouble understanding what to do. Please use HTML, CSS, and JavaScript Thank youarrow_forwardPlease help me figure out what I’m doing wrong (JavaScript)arrow_forward
- In addition to the instructions on the screenshot, please ensure that your program is made in C++ with comments. Please also ensure that screenshots are taken for the source code and the executed version, including all possible cases. Finally, add your code in a manner so I can just copy and paste it for review. Thanks.arrow_forwardC++. Please do not change the existing code. The instructions are in the image that is provided. Please zoom in or you can download the png file. Thank you! Time.cpp #include "Time.h" //Default Constructor //Constructor with parameters int Time::getHour() const { return hour; }int Time::getMinute() const { return minute; }int Time::getSecond() const { return second; }void Time::setHour(int h) { hour = h; }void Time::setMinute(int m) { minute = m; }void Time::setSecond(int s) { second = s; } int Time::timeToSeconds() const{ return (getSecond() + getMinute() * 60 + getHour() * 3600);} const Time Time::secondsToTime(int s) const{ int resultS = s % 60; s /= 60; int resultM = s % 60; s /= 60; int resultH = s % 24; return Time(resultH, resultM, resultS);} //toString // + // - // < // > // == ------ Time.h #ifndef TIME#define TIME #include <string> using namespace std; class Time{private: int hour; int minute; int second; int timeToSeconds() const;...arrow_forward
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education