Question
Create a program that uses an input file called Myfile.txt and perform the following: a. Create a function called WordsCount that reads your text file
Create a program that uses an input file called Myfile.txt and perform the following:
a. Create a function called WordsCount that reads your text file and returns the number of words in the first line of your program. The number of words must be printed from your main program.
b. Create a function called ReverseOrder that reads the second line of the file and prints the words in that line in reverse order. Example: if the second line reads: In my C++ class I learned Coding , it should output : Coding Learned I class C++ my In. Using an array may help.
Test your program with the following text: Computer science is considered as part of a family of five separate yet interrelated disciplines: computer engineering, computer science, information systems, information technology, and software engineering
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started