Menu

[solved]-Need Help Making C Skeleton Code Needs Finish Instructions Pictures Include Include Includ Q39070894

ineed help making this in c++the skeleton of the code is below just needs to be finish fromthe instructions of the pictures:*******************/#include <iostream>#include <string>#include <fstream>using namespace std;class order_record{public: string cell_number; string item_number; double quantity; double price; int processing_plant; double tax_rate; double order_tax; double net_cost; double total_cost;};class order_class{public: order_class(); ~order_class(); //de-allocates all memory allocate to INV by operator new. bool is_Empty(); //inline implementation bool is_full();//inline implementation int search(const string key);//returns location if item in INV; otherwise return -1 void add( ); //adds a order record to INV void remove(const string key); //removes all items in INV with a cell number that matches key. void double_size(); void process(); void print(); //prints all the elements in INV to the screenprivate: int count; int size; order_record *INV;};/************************************************************************************************************************************///Name: default constructor//Precondition: //Postcondition: //Decription: Reads the data file of purchase order information (cell number, item, quantity, price, and processing plant) into the dynamic array of order records, //INV. If the count become equal to the size the function double_size is called and the memory allocated to INV is doubled./************************************************************************************************************************************/order_class::order_class(){ cout << “The default constructor has been calledn”;}/***********************************************************************************************************************************///Name: is_Empty//Precondition: //Postcondition: //Decription: returns true if INV is empty/**********************************************************************************************************************************/bool order_class::is_Empty(){ return count == 0;}/**********************************************************************************************************************************///Name: is_full //Precondition: //Postcondition: //Decription: returns true if INV is full/*********************************************************************************************************************************/bool order_class::is_full(){ return count == size;}/**********************************************************************************************************************************///Name: search//Precondition: //Postcondition: //Decription: locates key in INV if it is there; otherwise -1 is returned/*********************************************************************************************************************************/int order_class::search(const string key){ return -1;}/*********************************************************************************************************************************///Name: add//Precondition: //Postcondition: //Decription: adds a call_record to INV; if INV is full, double_size is called to increase the size of INV. The user // is prompted to enter the cell number, item, quantity, price, and processing plant./********************************************************************************************************************************/void order_class::add( ){}/********************************************************************************************************************************///Name: remove//Precondition: //Postcondition: //Decription: removes all order records in INV with a cell number field that matches key, if it is there./*******************************************************************************************************************************/void order_class::remove(const string key){}/******************************************************************************************************************************///Name: double_size//Precondition: //Postcondition: //Decription: doubles the size (capacity) of INV/******************************************************************************************************************************/void order_class::double_size( ){ size *=2; order_record *temp = new order_record[size]; for(int i=0; i<count; i++) { temp[i] = INV[i]; } delete [ ] INV; INV = temp;}/******************************************************************************************************************************///Name: process//Precondition: //Postcondition: //Decription: calculate the tax rate, order tax, net cost, total order cost for every call record in INV./*****************************************************************************************************************************/void order_class::process(){}/****************************************************************************************************************************///Name: print//Precondition: //Postcondition: //Decription: prints every field of every call_record in INV formatted to the screen./***************************************************************************************************************************/void order_class::print(){ for(int i=0; i<count; i++) { // you add code here }}/****************************************************************************************************************************///Name: destructor//Precondition: //Postcondition: //Decription: de-allocates all memory allocated to INV. This will be the last function to be called (automatically by the compiler)//before the program is exited./***************************************************************************************************************************/order_class::~order_class(){ cout << “The destructor has been calledn”;}//Here is your driver to test the programint main(){ order_class myOrders;//declaring order_class object myOrders; the default constructor is called automically. cout << “**********************************************************************n”; //Test 1: cout << “Test 1: Testing default construcor, double_size, process, is_full and print ” << endl; myOrders.process( ); myOrders.print( ); cout << “End of Test 1” << endl; cout << “**********************************************************************n”; cout << “**********************************************************************n”; //Test 2: //void add(); cout << “Test 2: Testing add, double_size, process, is_full, and print ” << endl; myOrders.add( ); myOrders.print( ); cout << “End of Test 2” << endl; cout << “**********************************************************************n”; cout << “**********************************************************************n”; //Test 3: //void remove(string key); cout << “Test 3: Testing remove, is_Empty, search and print ” << endl; cout << “Removing 9546321555n”; myOrders.remove(“9546321555”); myOrders.print( ); cout << “Removing 787716590n”; myOrders.remove(“7877176590”); myOrders.print( ); cout << “Removing 3051234567n”; myOrders.remove(“3051234567”); myOrders.print( ); cout << “Removing 9546321555 —AGAIN— SHOULD GET MESSAGEn”; myOrders.remove(“9546321555”); myOrders.print( ); cout << “End of Test 3” << endl; cout << “**********************************************************************n”; cout << “**********************************************************************n”; //Test 4: //destructor will be invoked when object myOrders goes out of scope cout << “Test 4: Destructor called” << endl; cout << “End of Test 4” << endl; cout << “**********************************************************************n”; cout << “**********************************************************************n”; return 0;}
Objectives: 1. Develop and use an ADTs to define a class to manage a dynamic array: 2. Use a default constructor to initialiis the total number of cells allocated to IN 4. search is an integer public member function that has only one formal parametenew call records ): third the reconds in INV are copied into temp with the statement temple INV sing a f loop. Forth, the old

11:36 1 silLTE < COP3014_Assignment9... a Objectives: L Develop and use an ADTin define acestea a dynamic 2. Use a default c11:36 1 vilLTET <COP3014_Assignment9... Q 0 4. warch is park ember faction that has only one formal parameter, the key key is11:36 1 LTE COP 3014_Assignment9... a y by the taxes and da andera price INV ander -INV N V The cond u ce The last dended toObjectives: 1. Develop and use an ADT’s to define a class to manage a dynamic array: 2. Use a default constructor to initialize the state of your class: 3. Use a destructor te de-allocate memory allocated using the new operator This assignment is an extension of Programming A g ent Module 9’s Programming As You will implement called “arder les. The class will manage a dynamic array of purchase de recede Called the program for this “mas perdopp”. I have provided a skeleton driver of sporden.cpp” to help you implement this program Your input data will be in the file “purchase_data will implemen o “. The descriptions of the functions you 1. the default constructor to initialize the state of your class. The default constructor will read the data from the file “purchase data txt” into the dynamic array INV. INV becomes full, the function should call the function “double size to double the size capacity of INV. Remember count and INV are private members of your class and do not need to be pared to a member function of your class 2. Is Empty is a colcan public member function of the class. It has to formal practer b i sa member of the state of the class private member and does not need to be passed to it because the state of the class is known to all member functions of the class. If count then true is turned otherwise false is returned 3. is full is a Boolean public member function of the class. It has no formal parameters because count and size are members of the state of the class (private members and they do not need to be passed to it because the state of the class is known to all member functions of the class. If count size then true is retum: otherwise false. The size is the capacity which is the total number of cells allocated to INV 4. 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 array of records, INV and count are members of the state of the class and do not need to be used to a member function of the claws The function will return the location of key in INVirit is there; otherwel tumad S. add is a void public member function that inserts information fra onder record into INV. Duplicates cell numbers are ok, add will percomp the user for the cell number, item number, quantity, price and processing plant. You may call process record -prece INV when you add a new record add has no formul parameters 6. Remove is avoid publis h er functies that deletes will records with the cell member the matches the value stored in key. If duplicate records with the Samoell number they must all be deleted remove has only one formal parameter, the key. 7. double size is a veid public member function that doubles the capacity of INV, double size has no formal parameters because size, count and INV are all members of the state of the class, ceder class. First size is multipled by two second memory is allocated using the o rder record temp new call record size): thind the records in INV are copied into temp with the statement templu INVIO inga for loop. Forth, the old memory for INV is de-allocated using”delete INV Finally, INV is set to point to the new IN 13 Dashboard Calendar To Do Notifications Inbox is the total number of cells allocated to IN 4. search is an integer public member function that has only one formal parameter, the key key is the cell phone number for the recond you are scarching for. The array of records, INVdou 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 the otherwise -lis returned add is avoid public member function that inserts information for a onder record into INV. Duplicates collaborare ckadd will prompt the cro the cell number, item mumber, quantity, price and processing plan. You may call process record to re-process INV when you add a new record. addha formal parameters 6. remove is a vend public member function that delete all records with the cell number the matches the value stored in key. If duplicate records exist with the same cell number they must all be deleted remove the only one formal parameter, the key 7. double size is a void public member function that doubles the capacity of INV, double size has no formal parameters because size,count and INV are all members of the state of the class oder class. First, size is multiplied by two second, memory is allocated using the statement order record lamp new call record in thind the records in INV are copied into temp with the statement templi)-INV “wing a forloop Forth the old memory for INV is de-allocated using “delete [ JINY”. Finally, INV is to post to the memory pointed to by temp using “INV-om 8 process has two input parameters: INV and count. The functice will calculate the order tax rate tax ratel net cost of an ceder net cast the tax on an onder (order tax) and the tal cost of an ander tall ing the quantity of an item (price and processing plant identificate susher (processing plant for a purchase order rocoed onder rood. Roncti are using an array of records. Please consider the following: a) The tax rate an order (tax rate) is simply based on the processing plast identification number (Processing plant which is where the order was processed processing plantsothon tax r 6 SIC processing plant 110 then tax rate processing plan 200 then tax re p ocessing place then tax rate prog ant 500 then the 11%) b) The tax on an onder onder tax) is calculated by the following for ondertus (qu ) (price) I t e) 100 Hint INVorder_tax=(INVEi quantity NV price Dashboard Calendar To Do Notifications Inbox new call records ): third the reconds in INV are copied into temp with the statement temple INV sing a f loop. Forth, the old memory for INV is de-allocated using “delete INV Finally, INV is set to the memy pointed to by temp using “INV-temp process has two input parameter: INV . The function will calculate the order tax rate tax rate), cotofan onder het cost the taxe an onder (oder tax) and the tal cost of an ander sing the quantity cost of an item price and processing plant identification number (processing plants for a purchase order record order record Remember we are using an array of records. Please consider the following a) The tax rate on an onder (tax rate is simply based on the processing plant identification number wocessing plant which is where the processed processing pass then take s processing plant 110 then tax rate7 111 processing plant 200 then tax rate- 201proces a m500 then tax rate 99 processing plant 500 then t at-119) b) The tax on an order order tax) is calculated by the following form onder tax (quantity price tax rate/ 100 Hint INVO order tax-(INV quantity NVO price is calculated e) The net cost of ander netcost, which does not include try the following: net cost quantity) x price d) The total cost of an order (rounded to the nearest ho d h is calculated try the following formula Total cost cost order tax All tax and cost calcuation should be rounded to the neared hundredths 9. print is avaid public member function that has no formal parameters because count and INV me members of the state of the class. The function will print very fickdovy onder rocodis INV to the screen 10 the destructor te de-alexale all memory allocated INV. This function has no formal parameters because INV is amber of the state of the class, it will be called automatically by the compiler Use the driver amazon perders 9.cpp” to help you implement this program Output Format for the Function “print”. Consider the sample puble when and implemente The output should be in the f inger ell e r om. . tax rate, onder a cce d er cost. Use the information in the file produce the output Your push co n , but the . plant che a to be in the proper 9546321555 9546321555 5612971340 452XLY 2 20.82 503 742-623 300 10.34 7 924-YUT8 23.00 $ 1 93-111 475012200 11 6 7 25.58345435722 182.52 302.00322452 12.53 154.00 296.58 1845 2355.64 25469 Dashboard Calendar To Do Notifications Inbox 11:36 1 silLTE < COP3014_Assignment9… a Objectives: L Develop and use an ADT’in define acestea a dynamic 2. Use a default contractor to initial the water of your class 3. Use a destructor to delete m ary cated using the wa r TAMP AwY w a tches called “The will go podpowde d .com Verigata wale in the purchased . The des te 1 the default cost to in t he wake of your class. The conductor will read the data from the file purchased the dynamic ray INV. I INV becomes full,the function should all the function double site double the capacity of INV. Rome count and INV a private members of your class and do not need to be posed to a member function of your class 2. is Emptyisa Boolean public member function of the class. It has forma parter because out is a member of the state of the class (private member and does not need to be passed because these the class is a t all member functions of the class. If the true is returned otherwise false is returned 3. is full is a Boolean public member function of the class. It has s ome parameters becau s e of the state of the class prate members and they do not need to be passed to the use the state of the class is known to all member function of the class o – then we is return otherwise. These is the capacity which is the lumber of cells allocated to INV search is par public member function that has only one formal parameter, the key key is the cell phone where the y we Searching for. The way of records, INV and court remembers of these the class md do not need to be passed to a member face of the class. The function will return the location of key INV is here there disa veid public menber function that inserts information for ander record in INV. Dapate celle will prom the were the cell number, em number, quantity, price and processing plant. You may call process record process INV when you add a new record addha formal parameters 6. rere is a voi public we foto deles all with the cell number the matches the value word in key dupce s same cell number they mustall be deleted remove holy o 7. double wire is avaid public member function that dobles the capacity of INV. double has no formal parametersbe d INV are albers of the state of the class oder First s e d by twood, memy is allocated in the statement ander red new call records thind the records in INV are copied into temp with the statement templi)-INVising a forkop. Forth, the old memory INV is de-allocated using “delete INV Fally INV is to point to the memory pointed to by top using “INV mp el Dashboard Calendar To Do Notifications 11:36 1 vilLTET <COP3014_Assignment9… Q 0 4. warch is park ember faction that has only one formal parameter, the key key is the cell phone number the searching for. The aay of records, INV and 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 keyin INViis torcoherwise 5 add is avoid public member function that i s incomatic fora de record in INV. Duplicatesell numbers are ok add will prompt these for the cell number om umbo. quantity, price and processing plan. Yom call process recordare process INV when you add a new record add has 6 remove is avoid public member function that delmes all red with the el wwwmber the matches the value stored in key. If duplicate s is with the same ollumber they mustall be deleted movehasonly one parameter, the key 7. d e sire is a voi publice member function that doubles the capacity of INV, double size has no formal parameters because and INV are all members of the state of the class, onder class. First sinis e d by TWO woond. memory is allocated using the statement de record new call records , thind the records in INV are copied into lemp with the statement templö-INVO sing a few . For the old memy INV is de alocated using delle INV. F ly, INV s top to the memory pened to by musing “INVtemp & process has two input INV and Thefactice will calle the order tax rates el cost of an cedierinters the tr e nder fonder and the total cost of ander i ng the quantity of an item (price and processing plant identific u mber (processing plan for a p e rd ered Remember we are using an array of records. Please consider the following a) The tax rate on ander tax rate) is simply based on the proce identification number processing plant ich is where the new processed in plan t en tema processing plan 110 then tax rate=79111 processing plants-200 then tax rate – 8%20proc pl -500 then tax rate processing plant 500 then as a -11%) 1) The taxas de corder is called by the following for ander tax-quat INVorder r e – (INV 10 Hint V price N thich does not include tas is calculated c) The net of andere out by the following acquire Dashboard Calendar To Do Notifications inbox 11:36 1 LTE COP 3014_Assignment9… a y by the taxes and da andera price INV ander -INV N V The cond u ce The last dended to the newest by the following form Tal cost order tax Alt wanded o puncte INV we m en of these of the class. The functie will print every Sidid of every moodi INVS 10 the director de allocate all my lewe INV. This function has neformal parameters because INV member of the state of the class it will be called m ically by the epiler Use the driver mas poder po to buy this program Output Format for the Function “print: 5610 VUT 1034 23.00 13 Dashboard Calendar To Do Notifications inbox Show transcribed image text Objectives: 1. Develop and use an ADT’s to define a class to manage a dynamic array: 2. Use a default constructor to initialize the state of your class: 3. Use a destructor te de-allocate memory allocated using the new operator This assignment is an extension of Programming A g ent Module 9’s Programming As You will implement called “arder les. The class will manage a dynamic array of purchase de recede Called the program for this “mas perdopp”. I have provided a skeleton driver of sporden.cpp” to help you implement this program Your input data will be in the file “purchase_data will implemen o “. The descriptions of the functions you 1. the default constructor to initialize the state of your class. The default constructor will read the data from the file “purchase data txt” into the dynamic array INV. INV becomes full, the function should call the function “double size to double the size capacity of INV. Remember count and INV are private members of your class and do not need to be pared to a member function of your class 2. Is Empty is a colcan public member function of the class. It has to formal practer b i sa member of the state of the class private member and does not need to be passed to it because the state of the class is known to all member functions of the class. If count then true is turned otherwise false is returned 3. is full is a Boolean public member function of the class. It has no formal parameters because count and size are members of the state of the class (private members and they do not need to be passed to it because the state of the class is known to all member functions of the class. If count size then true is retum: otherwise false. The size is the capacity which is the total number of cells allocated to INV 4. 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 array of records, INV and count are members of the state of the class and do not need to be used to a member function of the claws The function will return the location of key in INVirit is there; otherwel tumad S. add is a void public member function that inserts information fra onder record into INV. Duplicates cell numbers are ok, add will percomp the user for the cell number, item number, quantity, price and processing plant. You may call process record -prece INV when you add a new record add has no formul parameters 6. Remove is avoid publis h er functies that deletes will records with the cell member the matches the value stored in key. If duplicate records with the Samoell number they must all be deleted remove has only one formal parameter, the key. 7. double size is a veid public member function that doubles the capacity of INV, double size has no formal parameters because size, count and INV are all members of the state of the class, ceder class. First size is multipled by two second memory is allocated using the o rder record temp new call record size): thind the records in INV are copied into temp with the statement templu INVIO inga for loop. Forth, the old memory for INV is de-allocated using”delete INV Finally, INV is set to point to the new IN 13 Dashboard Calendar To Do Notifications Inbox
is the total number of cells allocated to IN 4. search is an integer public member function that has only one formal parameter, the key key is the cell phone number for the recond you are scarching for. The array of records, INVdou 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 the otherwise -lis returned add is avoid public member function that inserts information for a onder record into INV. Duplicates collaborare ckadd will prompt the cro the cell number, item mumber, quantity, price and processing plan. You may call process record to re-process INV when you add a new record. addha formal parameters 6. remove is a vend public member function that delete all records with the cell number the matches the value stored in key. If duplicate records exist with the same cell number they must all be deleted remove the only one formal parameter, the key 7. double size is a void public member function that doubles the capacity of INV, double size has no formal parameters because size,count and INV are all members of the state of the class oder class. First, size is multiplied by two second, memory is allocated using the statement order record lamp new call record in thind the records in INV are copied into temp with the statement templi)-INV “wing a forloop Forth the old memory for INV is de-allocated using “delete [ JINY”. Finally, INV is to post to the memory pointed to by temp using “INV-om 8 process has two input parameters: INV and count. The functice will calculate the order tax rate tax ratel net cost of an ceder net cast the tax on an onder (order tax) and the tal cost of an ander tall ing the quantity of an item (price and processing plant identificate susher (processing plant for a purchase order rocoed onder rood. Roncti are using an array of records. Please consider the following: a) The tax rate an order (tax rate) is simply based on the processing plast identification number (Processing plant which is where the order was processed processing plantsothon tax r 6 SIC processing plant 110 then tax rate processing plan 200 then tax re p ocessing place then tax rate prog ant 500 then the 11%) b) The tax on an onder onder tax) is calculated by the following for ondertus (qu ) (price) I t e) 100 Hint INVorder_tax=(INVEi quantity NV price Dashboard Calendar To Do Notifications Inbox
new call records ): third the reconds in INV are copied into temp with the statement temple INV sing a f loop. Forth, the old memory for INV is de-allocated using “delete INV Finally, INV is set to the memy pointed to by temp using “INV-temp process has two input parameter: INV . The function will calculate the order tax rate tax rate), cotofan onder het cost the taxe an onder (oder tax) and the tal cost of an ander sing the quantity cost of an item price and processing plant identification number (processing plants for a purchase order record order record Remember we are using an array of records. Please consider the following a) The tax rate on an onder (tax rate is simply based on the processing plant identification number wocessing plant which is where the processed processing pass then take s processing plant 110 then tax rate7 111 processing plant 200 then tax rate- 201proces a m500 then tax rate 99 processing plant 500 then t at-119) b) The tax on an order order tax) is calculated by the following form onder tax (quantity price tax rate/ 100 Hint INVO order tax-(INV quantity NVO price is calculated e) The net cost of ander netcost, which does not include try the following: net cost quantity) x price d) The total cost of an order (rounded to the nearest ho d h is calculated try the following formula Total cost cost order tax All tax and cost calcuation should be rounded to the neared hundredths 9. print is avaid public member function that has no formal parameters because count and INV me members of the state of the class. The function will print very fickdovy onder rocodis INV to the screen 10 the destructor te de-alexale all memory allocated INV. This function has no formal parameters because INV is amber of the state of the class, it will be called automatically by the compiler Use the driver amazon perders 9.cpp” to help you implement this program Output Format for the Function “print”. Consider the sample puble when and implemente The output should be in the f inger ell e r om. . tax rate, onder a cce d er cost. Use the information in the file produce the output Your push co n , but the . plant che a to be in the proper 9546321555 9546321555 5612971340 452XLY 2 20.82 503 742-623 300 10.34 7 924-YUT8 23.00 $ 1 93-111 475012200 11 6 7 25.58345435722 182.52 302.00322452 12.53 154.00 296.58 1845 2355.64 25469 Dashboard Calendar To Do Notifications Inbox
11:36 1 silLTE

Expert Answer


Answer to i need help making this in c++the skeleton of the code is below just needs to be finish from the instructions of the pic… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *