Question
Using c++ The previous assignments used these functions: Constructor ready should not do anything Add(char c, int i) - should add c to position i
Using c++
The previous assignments used these functions:
Constructor ready should not do anything
Add(char c, int i) - should add c to position i of the list. If i >= size, add c to the end. If i
Operator
Operator*(int x) - should return a new fun_list with x copies of all the letters
Extract(string s) - should search the list to see if you could make s with the letters in the list. It should be case insensitive, and order does not matter. If s is in the list all the letters used should be removed from the list and the function should return true. If s is not in the list no letters should be removed and the function should return true.
Unique should return a fun_list with only one copies of each letter.
========== FUN_DRIVER.CPP ==========
#include
#include "fun_list.h"
int main(){
fun_list fl1;
fl1.add('A',5);
fl1.add('O',2);
fl1.add('l',2);
fl1.add('D',2);
fl1.add('3',4);
fl1.add('o',4);
fl1.add('E',-1);
fl1.add('S');
fl1.add('h',10000);
fl1 = fl1;
std::cout
fun_list fl2 = fl1;
fl2 = fl1*3;
std::cout
std::cout
std::cout
std::cout
std::cout
if(true){
fun_list fl3 = fl2;
std::cout
std::cout
std::cout
std::cout
std::cout
}
fun_list flu;
flu = fl2.unique();
std::cout
}
With the given os_driver.cpp and the three matrix text files. Write a fun_list.h file so that the fun_driver file will output the following. You must implement your fun_list class using a dynamic array. You must write a destructor, a copy constructor and overload the assignment operator. Your destructor must print DELETE, the copy constructor must print COPY and the overloaded assignment operator must print ASSIGNMENT. See the example on the next page. You can not hard code your answer. Note that your assignment, delete and copy statements may differ slightly based on implementation. vocstartsoft:~/environment/Assignment. $ ./fd 3 IS NOT A LETTER --ASSIGNMENT SE AOD LOH --COPY- --ASSIGNMENT --DELETE- SSSEEEAAAOO ODDD LLLOOOHHH TRUE SSS E E A A A O OD DDL O O O HH FALSE SSSEE AAA LODDD O O O OHH ----COPY --- FALSE SSS E E A A ALHDD D 0 0 0 0 HO TRUE SSSEEA DDOO O SSSE E A A A LODDD O O O O HH -DELETE ---ASSIGNMENT- --DELETE- ADELOS ---DELETE- --DELETE- --DELETE- vocstartsoft:-/environment/Assignment. $ |Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started