Write a program that opens a file and counts the


Program Purpose:

Write a program that opens a file and counts the whitespace-separated words in that file

Variables:
words-int -to count number of words present in a file
word -string - used to read the contents of a file
TEST PLAN

Normal case:
version opens its own source file:
Output:Number of words = 42

Bad Data case 1 :if this is unable to open the file (its own source file)

Bad Data case 2 :if we attempt to read another file which doesn't exist

Discussion:

The program opens its own source file and read the number of words and print the number of words present in the file

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a program that opens a file and counts the
Reference No:- TGS02447998

Now Priced at $10 (50% Discount)

Recommended (96%)

Rated (4.8/5)