Question: Q.1 Write a C++ program which have a user defined function random() whose functionality is to generate random words using English letters. Save All these
Q.1
Write a C++ program which have a user defined function random() whose functionality is to generate random words using English letters. Save All these words in text File out.txt.
Now, define another function duplicate() which identify how many words are generated/repeated more than once.
Note:
You have to do this question apart from using maps.
Ask user to enter the number of words. (less than 1000)
Ask user to enter minimum and maximum length of word.
Example:
User Input:
How many words you want to generate:700
What should be the minimum length of word:4
What should be the maximum length of word: 7
Sample Output:
Total words which are generated twice or more:37
List of these words: Kdilmmslikdldbcadpdwkdkd............... Kjdfi abcg
(total of 700 words)
Q.2:
Write a C++function called printLines() receiving two arguments: the first one must be a positive integer N, and the second one should be the name of a text file. The function must print on the screen/console the last N lines of the given file. N is a user provided value.
User Input: 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
