I need a solution for part 2 only, thank you. Workshop 8: S

I need a solution for part 2 only, thank you. Workshop 8: Smart… I need a solution for part 2 only, thank you.Workshop 8: Smart PointersIn this workshop, you combine two lists and use a smart pointer to ensure that memory is deallocated in the possible presence of an exception.Learning OutcomesUpon successful completion of this workshop, you will have demonstrated the abilities to:Build a program component of quadratic complexityuse a smart pointer to move an objectSubmission PolicyThe workshop is divided into two coding parts and one non-coding part:Part 1: worth 0% of the workshop’s total mark, is optional and designed to assist you in completing the second part.Part 2: worth 100% of the workshop’s total mark, is due on Sunday at 23:59:59 of the week of your scheduled lab. Submissions of Part 2 that do not contain the reflection are not considered valid submissions and are ignored.reflection: non-coding part, to be submitted together with Part 2. The reflection does not have marks associated to it, but can incur a penalty of max 40% of the whole workshop’s mark if your professor deems it insufficient (you make your marks from the code, but you can lose some on the reflection).The workshop should contain only work done by you this term or provided by your professor. Work done in another term (by you or somebody else), or work done by somebody else and not clearly identified/cited is considered plagiarism, in violation of the Academic Integrity Policy.Every file that you submit must contain (as a comment) at the top your name, your Seneca email, Seneca Student ID and the date when you completed the work.If the file contains only your work, or work provided to you by your professor, add the following message as a comment at the top of the file:If the file contains work that is not yours (you found it online or somebody provided it to you), write exactly which parts of the assignment are given to you as help, who gave it to you, or which source you received it from. By doing this you will only lose the mark for the parts you got help for, and the person helping you will be clear of any wrong doing.Compiling and Testing Your ProgramAll your code should be compiled using this command on matrix:/usr/local/gcc/10.2.0/bin/g++ -Wall -std=c++17 -g -o ws file1.cpp file2.cpp …-Wall: compiler will report all warnings-std=c++17: the code will be compiled using the C++17 standard-g: the executable file will contain debugging symbols, allowing valgrind to build better reports-o ws: the compiled application will be named wsAfter compiling and testing your code, run your program as following to check for possible memory leaks (assuming your executable name is ws):valgrind wsTo check the output, use a program that can compare text files. Search online for such a program for your platform, or use diff available on matrix.Part 1 (0%)The first portion of this workshop consists of modules:w8 (supplied)EmpProfile (incomplete)GeneratingList (incomplete)WritingRecord (supplied header, incomplete implementation)Your tasks for this part of the workshop are:Add a rangeValidator() function to the EmpProfile moduleAdd an operator += overload to the GeneratingList module using raw pointer syntaxAdd an implementation of Luhn Algorithm to the GeneratingList module to validate the SINComplete the writeRaw() function in the WritingRecord module using raw pointer syntaxEmpProfile ModuleThe EmpProfile module holds employee, salary and correct wages information.The Employee structure holds employee SIN and employee name.The Salary structure holds employee SIN and current salary.The EmployeeWage structure holds employee name and employee salary.Your Task: Add a rangeValidator() function to the EmploeeWage type. Your function reports an exception if the object’s salary is more than 99,999 or less than 0. Your function receives nothing and returns nothing.GeneratingList ModuleThe GeneratingList module defines a class that retrieves a list of records stored in a text file, holds the elements in an STL vector, provides access to them by index and displays them to an output stream.Your Task:Add an operator += overload to the GeneratingList template. Your function receives the address of an object to be stored in the GeneratingList container and moves the object into that container. Your overload returns nothing.Add an implementation of Luhn’s Algorithm to check the validity of the SIN. Your function receives a reference of a const std::string type representing the SIN to check and return true if the SIN is valid, false otherwise.WritingRecord ModuleYour Task: Implement the writeRaw() function. This function creates a list of active employees; an employee is considered active if both lists received as parameters contain an employee with the same SIN. For each active employee found in both lists, dynamically build a new object of type EmployeeWage and add it to the collection activeEmp only if it passes both validations below:validate the salary before adding it using the function you defined abovevalidate the SIN using Luhn’s algorithm you implemented above; if the SIN doesn’t pass validation, generate an exception of type std::stringw8 Module (supplied)The tester module has been supplied. Do not modify the existing code!Sample OutputWhen the program is started with the command (the input files are provided):ws NamesSIN.dat CorrectSalary.dat WrongSalary.datthe output should look like the one from the sample_output.txt file.Test Your CodeTo test the execution of your program, use the same data as shown in the output example above.Upload your source code to your matrix account. Compile and run your code using the latest version of the g++ compiler (available at /usr/local/gcc/10.2.0/bin/g++) and make sure that everything works properly.Then, run the following command from your account (replace profname.proflastname with your professor’s Seneca userid):~profname.proflastname/submit 345_w8_p1and follow the instructions.This part represents a milestone in completing the workshop and is not marked!Part 2 (100%)The second part of this workshop upgrades your solution to use smart pointers.Your tasks for this part of the workshop are:Add an operator += overload to the GeneratingList module using smart pointer syntaxComplete the WriteSmart() function in the WritingRecord module using smart pointer syntaxThese two functions should do the same thing as the raw pointer version, but using unique smart pointers instead.w8 Module (supplied)The tester module has been supplied. Do not modify the existing code!Sample OutputWhen the program is started with the command (the input files are provided):ws NamesSIN.dat CorrectSalary.dat WrongSalary.datCorrectSalary.dat506745728 35715.23505968818 33525.96174784181 95875.12524544921 15478.54EmpProfile.h#ifndef SDDS_EMPPROFILE_H#define SDDS_EMPPROFILE_H#include #include #include #include namespace sdds { struct Employee { std::string id; std::string name; bool load(std::ifstream& f) { f >> id >> name; return f.good(); } void print(std::ostream& os) const { os << std::setw(10) << id << std::setw(7) << name << std::endl; } }; struct Salary { std::string id; double salary; bool load(std::ifstream& f) { f >> id >> salary; return f.good(); } void print(std::ostream& os) const { os << std::setw(10) << id << std::setw(10) << salary << std::endl; } }; struct EmployeeWage { std::string name{}; double m_salary{}; int m_counter{}; static int recCount; static bool Trace; EmployeeWage() { m_counter = ++recCount; if (Trace) { std::cout << "Default Constructor [" << m_counter << "]" << std::endl; } } EmployeeWage(const std::string& str, double sal) { this->name = str; this->m_salary = sal; m_counter = ++recCount; if (Trace) { std::cout << "Ovdrloaded Constructor"<name = copyEmpProf.name; this->m_salary = copyEmpProf.m_salary; m_counter = ++recCount; if (Trace) { std::cout << "Copy Constructor "<< std::setw(11) << "[" << m_counter << "] from [" << copyEmpProf.m_counter <<"]" << std::endl; } } ~EmployeeWage() { if (Trace) { std::cout << "Destructor "<< std::setw(17) << "[" << m_counter << "]" << std::endl; } } //TODO: add a function here to check correct salary range void print(std::ostream& os)const { os << std::setw(15) << name << std::setw(10) << m_salary<#include #include #include #include #include #include namespace sdds { template class GeneratingList { std::vector list; public: GeneratingList(){} GeneratingList(const char* f) { std::ifstream file(f); if (!file) throw std::string(“*** Failed to open file “) + std::string(f) + std::string(” ***”); while (file) { T t; if (t.load(file)) list.push_back(T(t)); } } size_t size() const { return list.size(); } const T& operator[](size_t i) const { return list[i]; } //TODO: Implement the Luhn Algorithm to check the // valadity of SIN No’s //TODO: Overload the += operator with a smart pointer // as a second operand. //TODO: Overload the += operator with a raw pointer // as a second operand. void print(std::ostream& os) const { os << std::fixed << std::setprecision(2); for (auto& e : list) e.print(os); } }; template std::ostream& operator<<(std::ostream& os, const GeneratingList& rd) { rd.print(os); return os; }}#endif // !SDDS_GENERATINGLIST_HNamesSIN.dat799273984 Jill174784181 Mike524544921 Jack506745728 Kyle505968818 CarolWritingRecord.cpp#include “GeneratingList.h”#include “EmpProfile.h”#include “WritingRecord.h”using namespace std;namespace sdds { GeneratingList writeRaw(const GeneratingList& emp, const GeneratingList& sal) { GeneratingList activeEmp; // TODO: Add your code here to build a list of employees // using raw pointers return activeEmp; } GeneratingList writeSmart(const GeneratingList& emp, const GeneratingList& sal) { GeneratingList activeEmp; // TODO: Add your code here to build a list of employees // using smart pointers return activeEmp; }}WritingRecord.h#ifndef SDDS_WRITINGRECORD_H#define SDDS_WRITINGRECORD_H#include “GeneratingList.h”#include “EmpProfile.h”namespace sdds { GeneratingList writeRaw(const GeneratingList& emp, const GeneratingList& sal); GeneratingList writeSmart(const GeneratingList& emp, const GeneratingList& sal);}#endif // SDDS_WRITINGRECORD_HWrongSalary.dat506745728 35715.23505968818 33525.96174784181 95875.12524544921 154782.54w8_p2.cpp#include #include #include #include “GeneratingList.h”#include “EmpProfile.h”#include “WritingRecord.h”using namespace std;using namespace sdds;int EmployeeWage::recCount = 0;bool EmployeeWage::Trace = true;int main(int argc, char** argv){ cout << "Command Line: " << argv[0]; for (int i = 1; i < argc; i++) cout << " " << argv[i]; cout << endl << endl; if (argc != 4) { cerr << endl << "***Incorrect number of arguments***" << endl; return 1; } try { sdds::GeneratingList emp(argv[1]); sdds::GeneratingList correctSal(argv[2]); sdds::GeneratingList wrongSal(argv[3]); cout << setw(10) << "SIN No" << setw(17) << "Employee Name" << endl; cout << emp << endl; cout << "********************************************" << endl << "* Correct Salaries with SIN No's" << endl << "********************************************" << endl; cout << setw(10) << "SIN No" << setw(10) << "Salary" << endl; cout << correctSal << endl; cout << "********************************************" << endl << "* Wrong Salaries with SIN No's" << endl << "********************************************" << endl; cout << setw(10) << "SIN No" << setw(10) << "Salary" << endl; cout << wrongSal << endl; EmployeeWage::Trace = true; cout << "********************************************" << endl << "* Merging wrong salaries using Raw Pointers" << endl << "********************************************" << endl; try { GeneratingList empPro = writeRaw(emp, wrongSal); } catch (const string& msg) { cout << "ERROR: " << msg << endl; } cout << endl; cout << "********************************************" << endl << "* Merging wrong salaries using Smart Pointers" << endl << "********************************************" << endl; try { GeneratingList empPro = writeSmart(emp, wrongSal);; } catch (const string& msg) { cout << "ERROR: " << msg << std::endl; } EmployeeWage::Trace = false; cout << endl << endl; // no exceptions should be generated from the code below. cout << "********************************************" << endl << "* Merging correct salaries using Raw Pointers" << endl << "********************************************" << endl; { GeneratingList empPro = writeRaw(emp, correctSal); cout << setw(5) << "Employee Name" << setw(10) << "Salary" << endl; cout << empPro << endl; } cout << "********************************************" << endl << "* Merging good prices using Smart Pointers" << endl << "********************************************" << endl; { GeneratingList empPro = writeSmart(emp, correctSal); cout << setw(5) << "Employee Name" << setw(10) << "Salary" << endl; cout << empPro << endl; } } catch (...) { cout << "ERROR: Unknown error!"; } return 0;}sample_output.txtCommand Line: ws NamesSIN.dat CorrectSalary.dat WrongSalary.dat SIN No Employee Name 799273984 Jill 174784181 Mike 524544921 Jack 506745728 Kyle 505968818 Carol********************************************* Correct Salaries with SIN No's******************************************** SIN No Salary 506745728 35715.23 505968818 33525.96 174784181 95875.12 524544921 15478.54********************************************* Wrong Salaries with SIN No's******************************************** SIN No Salary 506745728 35715.23 505968818 33525.96 174784181 95875.12 524544921 154782.54********************************************* Merging wrong salaries using Raw Pointers********************************************Ovdrloaded Constructor [1]Copy Constructor [2] from [1]Destructor [1]Ovdrloaded Constructor [3]Destructor [3]Destructor [2]ERROR: *** Employees salaray range is not valid********************************************* Merging wrong salaries using Smart Pointers********************************************Ovdrloaded Constructor [4]Copy Constructor [5] from [4]Destructor [4]Ovdrloaded Constructor [6]Destructor [6]Destructor [5]ERROR: *** Employees salaray range is not valid********************************************* Merging correct salaries using Raw Pointers********************************************Employee Name Salary Mike 95875.12 Jack 15478.54 Kyle 35715.23 Carol 33525.96********************************************* Merging good prices using Smart Pointers********************************************Employee Name Salary Mike 95875.12 Jack 15478.54 Kyle 35715.23 Carol 33525.96   Computer Science Engineering & Technology C++ Programming OOP 345

How it works

  1. Paste your instructions in the instructions box. You can also attach an instructions file
  2. Select the writer category, deadline, education level and review the instructions 
  3. Make a payment for the order to be assignment to a writer
  4.  Download the paper after the writer uploads it 

Will the writer plagiarize my essay?

You will get a plagiarism-free paper and you can get an originality report upon request.

Is this service safe?

All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your essay today and save 20% with the discount code ESSAYHELP