please help, in C++Tunctions you wilmplementare as follows 2 3 The copy constructor will performa deep copy of an object (You implemented this in the previous program.) the default constructor to initialize the state of your class. The default will read the data from the file “purchase determine the dyna m y INV, INV becomes all the function should call the functiona le d e the capacity of INV. Remember,count and INV are private member of your class and do not need to be passed to a member function of your class (You implemented this is the previous progr ) is Empty is a Bolo public member functies of the class. It has no formal parameter he t is a member of the state of the class e member and does not need to be passed to b e the state of the classi c herunc the class t o the true is relumed therwise be is med (You implemented this is the previous programs.) is full is a Boolean public member function of the class. It has no formal pactes beco e are m ors of the state of the c rime they do not need to be passed to it because the state of the classic a l member functions of the class. If count then this motherwise be the size is the capacity which is the number of cells located to INV. 5. (You implemented this in the previous program) search is an integer public member function that has only one formal parameter, the key key is the cell phone number for the record you are searching for. The way of records, INV and count are members of the state of the class and do not need to be passed to a member function of the class: The function will return the location of key in INV if it is there; otherwise istmed (You implemented this in the previous program) add is a voi public member function that inserts information for a onder conditie INV. Duplicates cell numbers are ok add will the ser for the cell number item number, quantity, price and processing plant You may call process recond to process INV when you add a new rod a s formal parameters overload operator as a member function of ander class with chaine This function will have the same functie s the functie Recall the following about the functi o n is a vond public member function that delictes all records with the clumbersodinky duplicate records exist with the same celle d a lbe deleted m ehad only meal the Note, we are overleading with chaining we must return the wrote this you implemented this is the previous program d e seis avoid public member functies that does the INV er has no falutab , INV benefhe state of the class, onder class. First, size is led by the second memory is allocated using the statement onder record sempnew call records third the records in INV a copied to the statement templ)-INVEising a for loop. Forth, the old memory for INV is de allocated using del INV. Finally, INV is set to point to the new memory pointed to by tomp using “INV=tem 9. (You implemented this in the previous program process has two input parame : INV and The function will alwate the order tax rate (taxallet cost of an order met cost the tax on d er onder a nd the total cost of an order total cost using the quantity, cost of an item (price and processing plant identification number process plant) for a purchase order record onder_record). Remember, wewe using an array of records. Please consider the following memory pointed to by temp using “INV = tempº 9. (You implemented this in the previous program.) process has two input parameters: INV and count. The function will calculate the order tax rate (tax rate, net cost of an order (net cost), the tax on an order onder tax) and the total cost of an order (total cost) using the quantity, cost of an item (price and processing plant identification number processing plant) for a purchase order record onder record). Remember, we are using an array of records. Please consider the following a) The tax rate on an order (taxmae) is simply based on the processing plant identification number (processing plant which is where the order was processed (O processing plant 50 then tax rate 6%; SIC processing plant -110 then tax rate 79: IUC processing plant -200 then tak_rate=8%201-processing plant-500 then tax_rate=9% processing plant >500 then tax rate -11%). b) The tax on an order (order_tax) is calculated by the following formulac onder tax (quantity) x (price) (tax rate) / 100 Hint: INV).order_tax – (INV quantity* INV price The net cost of an order (net_cost), which does not include tax, is calculated by the following net_cost – (quantity) x price c) The total cost of an order (rounded to the nearest houndredth) is calculated by the following formular Total cost = net cost order tax All tax and cost calcuations should be rounded to the nearest hundredths. 10,overload operator as a friend function of order class with chaining. This function will have the same functionality as the “print function it will print INV to the screen. Recall the Following about the function print: “print is avoid public member function that has no formal parameters because count and INV are members of the state of the class. The function will print every field of every order record in INV to the screen”. 11. the destructor to deallocate all memory allocated to INV, This function has no formal parameters because INV is a member of the state of the class, it will be called automatically by the compiler Use the driver amazon_porders 11.cpp” to help you implement this program. Output Format for the overloaded operator<<“: Consider the sample output table below when designing and implementing the overloaded operator operator . The output should be in the following order cell phone number item, quantity, price, processing plant, tax rate, onder tax, netcost, total order cost). Use the information in the data file “purchase_data.txt to produce the output. Your output should not contain any titles, but the output must be in the proper onder 9505321555 452-XLY 9565321555 742-673 5612971340924 YUT 3051234567 913-11T 2 300 8 4 7 70.82 503 1115.58 10.1447 6 182.52 23.00517 12.88 20.12 200 8 188.45 141.64 3042.00 184,00 2355.64 157 22 322452 196.88 244.09 information in the data file “purchase data.txt” to produce the output. Your output should not contain any titles, but the output must be in the proper ander 9546321555 452 XLY 9545321555 742-6Z3 5612971340924 YUT 3051234567 913-11T 2 3 00 3 47 70.82 503 10.1447 23.00 51 20.12.200 1115.58 141.64 6 182.52 3042.00 12.83 184.00 168 45 2355.64 15722 322452 196.88 24.09 7 8 InputStream: In the assignment you will declare one ifstream to bind your input to the file “purchase data.xi” Whenever a program performs file i/o you must include the stream library. Add the following statements to your program: For source file, “amazon_pordersil.cpp”: Add include to your include statements in your source file. Add include <string to your #include statements in your source file Format of the input data file input filename is purchase data. De set include (cell phone number, item, quantity, price, processing plant) 9546321555 452-XLY 22082 9546321555 742-673 300 1014 5612971340 924-YUT 21.00 3051234567 93-117 47 50 12 7542346622 453-TTT 92 25.25 213-ABC 1510502 111 112 3241 8776219988 SSS 100 12 12 9042224556 290-P 23 297 962 5612278899 9546321555 893-42T 008-LLS 642 081 90 45 80 429999 14 10.14 136648 22 18 503 3051234567 2542346622 742.623 742-624 742.625 742-626 213 ABC 321-XMZ BL-555 9544321011 8226219988 9042224556 7872126590 5517278899 8776219988 9042224556 7877176590 108 1.17 6710502 SOO 32.41 43 12 12 16 9.92 82 9.62 290 P23 232-000 232-000 232-000 4 45 9.62 201 Show transcribed image text Tunctions you wilmplementare as follows 2 3 The copy constructor will performa deep copy of an object (You implemented this in the previous program.) the default constructor to initialize the state of your class. The default will read the data from the file “purchase determine the dyna m y INV, INV becomes all the function should call the functiona le d e the capacity of INV. Remember,count and INV are private member of your class and do not need to be passed to a member function of your class (You implemented this is the previous progr ) is Empty is a Bolo public member functies of the class. It has no formal parameter he t is a member of the state of the class e member and does not need to be passed to b e the state of the classi c herunc the class t o the true is relumed therwise be is med (You implemented this is the previous programs.) is full is a Boolean public member function of the class. It has no formal pactes beco e are m ors of the state of the c rime they do not need to be passed to it because the state of the classic a l member functions of the class. If count then this motherwise be the size is the capacity which is the number of cells located to INV. 5. (You implemented this in the previous program) search is an integer public member function that has only one formal parameter, the key key is the cell phone number for the record you are searching for. The way of records, INV and count are members of the state of the class and do not need to be passed to a member function of the class: The function will return the location of key in INV if it is there; otherwise istmed (You implemented this in the previous program) add is a voi public member function that inserts information for a onder conditie INV. Duplicates cell numbers are ok add will the ser for the cell number item number, quantity, price and processing plant You may call process recond to process INV when you add a new rod a s formal parameters overload operator as a member function of ander class with chaine This function will have the same functie s the functie Recall the following about the functi o n is a vond public member function that delictes all records with the clumbersodinky duplicate records exist with the same celle d a lbe deleted m ehad only meal the Note, we are overleading with chaining we must return the wrote this you implemented this is the previous program d e seis avoid public member functies that does the INV er has no falutab , INV benefhe state of the class, onder class. First, size is led by the second memory is allocated using the statement onder record sempnew call records third the records in INV a copied to the statement templ)-INVEising a for loop. Forth, the old memory for INV is de allocated using del INV. Finally, INV is set to point to the new memory pointed to by tomp using “INV=tem 9. (You implemented this in the previous program process has two input parame : INV and The function will alwate the order tax rate (taxallet cost of an order met cost the tax on d er onder a nd the total cost of an order total cost using the quantity, cost of an item (price and processing plant identification number process plant) for a purchase order record onder_record). Remember, wewe using an array of records. Please consider the following
memory pointed to by temp using “INV = tempº 9. (You implemented this in the previous program.) process has two input parameters: INV and count. The function will calculate the order tax rate (tax rate, net cost of an order (net cost), the tax on an order onder tax) and the total cost of an order (total cost) using the quantity, cost of an item (price and processing plant identification number processing plant) for a purchase order record onder record). Remember, we are using an array of records. Please consider the following a) The tax rate on an order (taxmae) is simply based on the processing plant identification number (processing plant which is where the order was processed (O processing plant 50 then tax rate 6%; SIC processing plant -110 then tax rate 79: IUC processing plant -200 then tak_rate=8%201-processing plant-500 then tax_rate=9% processing plant >500 then tax rate -11%). b) The tax on an order (order_tax) is calculated by the following formulac onder tax (quantity) x (price) (tax rate) / 100 Hint: INV).order_tax – (INV quantity* INV price The net cost of an order (net_cost), which does not include tax, is calculated by the following net_cost – (quantity) x price c) The total cost of an order (rounded to the nearest houndredth) is calculated by the following formular Total cost = net cost order tax All tax and cost calcuations should be rounded to the nearest hundredths. 10,overload operator as a friend function of order class with chaining. This function will have the same functionality as the “print function it will print INV to the screen. Recall the Following about the function print: “print is avoid public member function that has no formal parameters because count and INV are members of the state of the class. The function will print every field of every order record in INV to the screen”. 11. the destructor to deallocate all memory allocated to INV, This function has no formal parameters because INV is a member of the state of the class, it will be called automatically by the compiler Use the driver amazon_porders 11.cpp” to help you implement this program. Output Format for the overloaded operator
Expert Answer
Answer to Tunctions you wilmplementare as follows 2 3 The copy constructor will performa deep copy of an object (You implemented t…