Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

analyzeFile(); accepts two parameters: the path to a file as a string, and another string (upper, lower, digit, or space); open the file, then determine

image text in transcribed
analyzeFile(); accepts two parameters: the path to a file as a string, and another string ("upper", "lower", digit", or "space"); open the file, then determine how many characters of the chosen type are in the file, then close the file; make the number available to the calling interface otherwise. analyzeFile() should call one of the following functions: countUpper (): return the number of uppercase letters in the file countLower(): return the number of lowercase letters in the file countDigits(): return the number of digits in the file countSpaces(): return the number of whitespace characters (including tabs but not line breaks) found in the file countWords(): return the number of whitespace characters (including tabs) found in the file isLower(): accepts a character as a parameter; return true if it is a lowercase letter and false otherwise isUpper(): accepts a character as a parameter; return true if it is an uppercase letter and false otherwise isDigit(): accepts a character as a parameter return true if it is a digit and false otherwise Use these functions to create a program that: Continuously prompts the user to enter: the path to a file as a string the type of character to be searched as a string When the file is successfully opened and a valid character type has been chosen: count the instances of the selected character type in the file Display the results Sample Run 1 (Inputs will be shaded. Bold outputs must change depending on the input.) Enter the absolute path to a file. S:\mbrown_shared\Input_Files\lab6-5.txt File opened successfully; what type of character should be counted? lowercase There are 93 lowercase letters in the file

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

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions