subject

1 Objectives: Practice with system calls to: a) perform file operations; and b) create and use processes.
2. Description:
Overview: You will write a program (says wordcount. c) to find out the number of words in multiple text files. Specifically, the program will first determine the number of files to be processe Then, the program will create multiple processes with each process being responsible for one file to count its words. The typical format to run the program with input parameters is as follows: /wordcount File_1 File 2 File n
Details: First, the program needs to determine the number of files to be processed. This can be done with the argc parameter of the main function; Then, the argv parameter can be used to retrieve the name for each file.
After that, fork) system call will be used to create multiple processes (one for each file). For each child process, it can simply invoke a function to count the number of words inside a specific file and print out the result like (note that, no inter-process communication is required as child processes will report (i. e., print out) their results individually):
Child process for File_x: number of words is XXX
The main process should wait until all child processes report their results; then, the main process report the end of the program with the print out: All n files have been counted!
For word counting, you could simply use the space character as the delimiter. Anything that are not separated by the space will be counted as a single word. For instance, the example "The first program is a Hello-world." will be reported as 6 words (where Hello-world is counted as a single word). You could compare your results using the wc utility that is available on Linux machines.
3. Submission Requirements
The assignment needs to be submitted on Blackboard. The submission includes two parts:
A. Source codes: This assignment should have only one source file (wordcount. c) and multiple header files (as you lik. Your program needs to have proper comments (e. g explanations for functions and variables etc.). It will be graded based on both functional correctness and clearity of the necessary comments.
B. Report. txt: In this text file, you need to report: a) the status of your program (completed or not; partial credit will be given even the program is not completed); b) the design of your program (what and how system calls are utilized etc.); c) what help (if any) you get from TA and/or your classmates; and d) comments and suggestions to improve this assignment.
C. Submission: Please have all the above files zipped into a single file assignl-abc123.zip and upload the file on Blackboard, where abc123 should be your UTSA ID.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:50
In this lab, you complete a prewritten c++ program for a carpenter who creates personalized house signs. the program is supposed to compute the price of any sign a customer orders, based on the following facts: the charge for all signs is a minimum of $35.00. the first five letters or numbers are included in the minimum charge; there is a $4 charge for each additional character. if the sign is made of oak, add $20.00. no charge is added for pine. black or white characters are included in the minimum charge; there is an additional $15 charge for gold-leaf lettering. instructions ensure the file named housesign.cppis open in the code editor. you need to declare variables for the following, and initialize them where specified: a variable for the cost of the sign initialized to 0.00 (charge). a variable for the number of characters initialized to 8 (numchars). a variable for the color of the characters initialized to "gold" (color). a variable for the wood type initialized to "oak" (woodtype). write the rest of the program using assignment statements and ifstatements as appropriate. the output statements are written for you. execute the program by clicking the run button. your output should be: the charge for this sign is $82. this is the code, // housesign.cpp - this program calculates prices for custom made signs. #include #include using namespace std; int main() { // this is the work done in the housekeeping() function // declare and initialize variables here // charge for this sign // color of characters in sign // number of characters in sign // type of wood // this is the work done in the detailloop() function // write assignment and if statements here // this is the work done in the endofjob() function // output charge for this sign cout < < "the charge for this sign is $" < < charge < < endl; return(0); }
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Jennifer has to set up a network in a factory with an environment that has a lot of electrical interference. which cable would she prefer to use? jennifer would prefer to use because its metal sheath reduces interference.
Answers: 1
question
Computers and Technology, 23.06.2019 18:50
What is transmission control protocol/internet protocol (tcp/ip)? software that prevents direct communication between a sending and receiving computer and is used to monitor packets for security reasons a standard that specifies the format of data as well as the rules to be followed during transmission a simple network protocol that allows the transfer of files between two computers on the internet a standard internet protocol that provides the technical foundation for the public internet as well as for large numbers of private networks
Answers: 2
question
Computers and Technology, 24.06.2019 09:00
Why might you chose to crest a function resume
Answers: 1
You know the right answer?
1 Objectives: Practice with system calls to: a) perform file operations; and b) create and use proc...
Questions
question
Arts, 06.01.2021 21:40
question
Business, 06.01.2021 21:40
question
Mathematics, 06.01.2021 21:40
question
Mathematics, 06.01.2021 21:40
question
Mathematics, 06.01.2021 21:40
question
Chemistry, 06.01.2021 21:40
question
History, 06.01.2021 21:40
question
English, 06.01.2021 21:40
question
Mathematics, 06.01.2021 21:40
Questions on the website: 13722362