can you help me plz in these 2 assignments:

assignment1:

Create a new string ADT (using a dynamic array).
The data members of the String class are a pointer to the start of your string and an integer representing the length of that string. The following methods should be provided:

  1. Default constructor.
  2. Initialization constructor.
  3. Copy constructor.
  4. Destructor
  5. A function called getLength() that returns the length of the string.
  6. A function called getString() that sets the string.
  7. A function called searchString_Ch() that searches the master string for a specific characters. If searched character is found, appropriate message should be printed out along with its position. Otherwise, message not found is printed out.
  8. A function called search_Sub() that searches the master string for specific substring "ss". If searched character is found, appropriate message should be printed out along with its position. Otherwise, message not found is printed.
  9. A function that called insertString() that inserts a substring "ss" at a given position POS in the master string.
  10. A function called moveString() that moves a substring "ss" (if found in the master string) to the end of the master string.
  11. A function called replaceString() that replaces all occurrences of substring, say "ss" (is found in the master string), by another substring, say "tt". The function must return the position POS of the sub string if it is found or return 0 if the substring was not found.
  12. Overload the function operators: ! ( to test if string is empty), += (to concatenate 2 strings); == (to test equality); = (to assign a string s2 to string s1)

Assignment2:

Create a user-defined structure type Array with only 2 integer members:
An array a[] of integer numbers.
Integer variable called size that refer to the actual dimension of the array a[ ].
Write a c program that defines a single array structure (object) called Arrayoper. Provide functions that perform the following operations on the array a[]:

  1. A user-defined function called setArray( ) to assign values for the array a[ ].
  2. A user-defined function called addArray( ) to add any 2 arrays x[ ] and y[ ] and store the result on array z [ ].
  3. A user-defined function called Maxarray( ) to find the maximum element of an array.
  4. A user-defined function called SortArray( ) to sort any array in ascending order.
  5. A user-defined function called Searcharray( ) to search an array for a given target. It returns the position of the target if it has been found or returns a message saying target was not found.

Remarks:

  1. Use the concept of pointer to perform all operations on the array a[ ].
  2. As an example use the following array a[ ] ={ 3,2,8,4,1,6}
    Elements of the array a[ ] should be entered via the keyboard and passed via the function main() to the user-defined function setarray().
  3. As a target to be searched in the array use both targets: 8 and 5.
  4. All outputs must be performed within the main function and NOT via any user-defined function.
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.