Question: cpp FILE INPUT AND OUTPUT COULD YOU ADD COMMENTS . 1- Write a function G, which takes a file name as its input argument, for

cpp FILE INPUT AND OUTPUT

COULD YOU ADD COMMENTS .

1- Write a function G, which takes a file name as its input argument, for example, G(string s). The function G then generates 100 random strings (ie. words), randomly ranging in length between 1 - 10 letters. All letters in the random string are lower case and all letters have been randomly selected (hint: ASCII table). All these random words are then written to the file, called output1.txt, where each word is separated by a single empty space. The file name output1.txt is the input argument s of the function G. That is, in your main function, call the function G as G(output1.txt).

2- Write a function H, which takes a file name as its input argument, for example, H(string s). The function H then generates 100 a random string (ie. words), randomly ranging in length between 1 - 10 letters. All letters in the random string are lower case and all letters have been randomly selected (hint: ASCII table). All these random words are then written to the file, called output2.txt, where each word is separated by a single empty space, followed by a random single digit, and then another empty space: xyz 8 wbcv. The file name output2.txt is the input argument s of the function H. That is, in your main function, call the function H as H(output2.txt).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!