Menu

[solved]-Warning Use System Function Call Throughout Assignment Note May Use Sample Code Provided Q39067354

Warning: You should not use system(...) function call throughout this assignment. Note. You may use some sample code provid

Warning: You should not use “system(…)” function call throughout this assignment. Note. You may use some sample code provided (see below) for this part. Create a folder (a2part2) under cs3377 folder for this part. Design and implement a C++ program (a2part2.cpp) with the password file (/etc/passwd) to do the following tasks. Note. To compile a C++ program, use g++. If you use gcs, use: -lstde++ option gcc hello.cpp -o hello -lstdc++ Source: https://gcc.gnu.org/projects/cxx-status.html First, create a text file (staffl.txt) which contains its staff records as listed below. Each line represents one staff record. Each staff record consists of 7 fields of each staff: (1) stafflD. (2) staffName, (3) staffPosition, (4) staffDepartment, (5) staffHireDate, and (6) staffSalary, Each field is separated by a colon (“:”). Marketing :09/26/06:110000 :12/12/07:100000 personnel :07/06/08: 90000 marketing :03/12/09: 80000 :12/12/10: 70000 0600:Employeel :employee:production:03/12/11: 60000 0700:Employee2 :employee:marketing :04/19/12: 50000 0800 Employee3 :employee:personnel :05/11/13:120000 :08/30/14:110000 :09/03/15:100000 :06/05/16: 90000 :09/12/17: 80000 0100:Staff1 0200:Staff2 0300:Staff3 0400:Staff4 0500:Staff5 staff staff accounts staff staff sales staff 0900 Employee4 :employee:admin 1000:Employee5 :emplovee:sales 1100 Employee6 :employee accounts 1200:Managerl 1300:Manager2 1400:Manager3 manager sales manager :production:09/07/18: 70000 05/01/19: 60000 manager sales Design and implement a C++ program to do the following tasks For each task or step, print a proper heading to the console (e.g., “Task#1. The listing of staffl objects”). Task #1. You program will do: (1) Design and implement a class of “staffl” with constructor and destructor, with the member variables (each member for each field of the record), and the methods for get and set each field, (2) Instantiate each staffl object from each record read from “staffl.txt” file. (3) Print each object of staffl to the console with a heading (e.g., “Task#1. The listing of staffl objects”). Task #2. Continue with the program in Task#1 to do the following task: (1) Output each instance of staffl object (that is, a binary output) to a file “staff2.obj” file. (2) Delete (clear) all “staffl” objects. (4) Read (restore) each staff object from “staff2.obj” file for “staffl” object (5) Print each object of “st a heading to the console wi Task #3. Verify your program run with ls-1 od staff2.obj Task #4. Provide a Makefile file to compile your program Show transcribed image text Warning: You should not use “system(…)” function call throughout this assignment. Note. You may use some sample code provided (see below) for this part. Create a folder (a2part2) under cs3377 folder for this part. Design and implement a C++ program (a2part2.cpp) with the password file (/etc/passwd) to do the following tasks. Note. To compile a C++ program, use g++. If you use gcs, use: -lstde++ option gcc hello.cpp -o hello -lstdc++ Source: https://gcc.gnu.org/projects/cxx-status.html First, create a text file (staffl.txt) which contains its staff records as listed below. Each line represents one staff record. Each staff record consists of 7 fields of each staff: (1) stafflD. (2) staffName, (3) staffPosition, (4) staffDepartment, (5) staffHireDate, and (6) staffSalary, Each field is separated by a colon (“:”). Marketing :09/26/06:110000 :12/12/07:100000 personnel :07/06/08: 90000 marketing :03/12/09: 80000 :12/12/10: 70000 0600:Employeel :employee:production:03/12/11: 60000 0700:Employee2 :employee:marketing :04/19/12: 50000 0800 Employee3 :employee:personnel :05/11/13:120000 :08/30/14:110000 :09/03/15:100000 :06/05/16: 90000 :09/12/17: 80000 0100:Staff1 0200:Staff2 0300:Staff3 0400:Staff4 0500:Staff5 staff staff accounts staff staff sales staff 0900 Employee4 :employee:admin 1000:Employee5 :emplovee:sales 1100 Employee6 :employee accounts 1200:Managerl 1300:Manager2 1400:Manager3 manager sales manager :production:09/07/18: 70000 05/01/19: 60000 manager sales Design and implement a C++ program to do the following tasks For each task or step, print a proper heading to the console (e.g., “Task#1. The listing of staffl objects”). Task #1. You program will do: (1) Design and implement a class of “staffl” with constructor and destructor, with the member variables (each member for each field of the record), and the methods for get and set each field, (2) Instantiate each staffl object from each record read from “staffl.txt” file. (3) Print each object of staffl to the console with a heading (e.g., “Task#1. The listing of staffl objects”). Task #2. Continue with the program in Task#1 to do the following task: (1) Output each instance of staffl object (that is, a binary output) to a file “staff2.obj” file. (2) Delete (clear) all “staffl” objects. (4) Read (restore) each staff object from “staff2.obj” file for “staffl” object (5) Print each object of “st a heading to the console wi Task #3. Verify your program run with ls-1 od staff2.obj Task #4. Provide a Makefile file to compile your program

Expert Answer


Answer to Warning: You should not use “system(…)” function call throughout this assignment. Note. You may use some sample code p… . . .

OR


Leave a Reply

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