Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

Capturing value from customers

Answered: 1 week ago

Question

Teachers Role?

Answered: 1 week ago