Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program consisting of (a) a function words equal (char w1[ ], char w2[ ], int len). The function returns whether both strings

Write a C++ program consisting of

(a) a function words equal (char w1[ ], char w2[ ], int len).

The function returns whether both strings are exactly equal. The

third parameter int len contains the maximum length of the strings

w1 and w2.

(b) and a main() function:

- Provide memory for an array of 1000 words of 100 letters each.

letters each.

- All words are to be read from a file and stored in the field provided above.

The name of the file is to be read in by the user and has a maximum of

41 letters. If an error occurs in the file work, it is to be

it is assumed that this error occurred due to a wrong input by the user.

by the user. In this case the program must not be

must not be terminated in this case, but must guarantee the reading of the data.

The first value of the file contains the number of words contained in the file

followed by all words.

To solve the task, the use of the library fstream

is allowed.

- Using the function words designed in 1a, find out how often a word entered by the user occurs in the field

occurs. Output the result to the user.

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_2

Step: 3

blur-text-image_3

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

1. Traditional and modern methods of preserving food Articles ?

Answered: 1 week ago

Question

What is sociology and its nature ?

Answered: 1 week ago

Question

What is liquidation ?

Answered: 1 week ago

Question

Explain the different types of Mergers.

Answered: 1 week ago