Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please provide a runnable source code to the follwing problem: Use C++ language 3) Well-formed documents (http://wals.info/feature/description/3) Write a program that reads characters of a
Please provide a runnable source code to the follwing problem: Use C++ language
3) Well-formed documents (http://wals.info/feature/description/3) Write a program that reads characters of a document from standard input until the EOF is reached counting the number of a. consonants, b. vowels c. opening and closing parentheses (( and'), d. opening and closing brackets', and ']' ), e. opening and closing braces (, and'y' ), f. whitespace (spaces, tabs, newlines, etc.) g. and everything not one of the above After reading all input, determine if your document is a well-formed by inspecting the ratio of consonants to vowels (calculated simply by dividing the number of consonants by the number of vowels, using floating-point division of course). A well-formed document has a ratio greater than or equal to the well-formed document threshold, which is 2% (the exact value isn't the important point, adjust as necessary) Display to standard output for each of the character groups above their ratio to the total number of non- whitespace characters, and the consonants to vowels ratio. (8 ratios in all) Display a message indicating the document is well-formed or not well-formed Make two runs. Use your source code file (wellFormedDoc.cpp for example) as the input of your first run, and the "Function Overloading & Default Arguments.txt" file provided as the input of your second run. You should redirect these files to standard input at the command line Hint: Use the functions fromStep 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