Write a program that reads the text file's contents and calculates and outputs the following in this order:   • The number of words in the file • The number of lines in the file • The number of uppercase letters in the file • The number of lowercase letters in the file • The number of digits in the file • The number of letter H's in the file • The number of whitespace characters in the file   NOTE: Your program should include at least one try-except error handling statement block. Your program should also validate any input that could cause your program to crash. I'm Henery The Eighth, I Am! Henery The Eighth, I Am, I am!I got married to the widow next door,She's been married seven times before.And ev'ryone was a Henery,She wouldn't have Willie or a Sam.I'm her eighth old man named Henery,Henery the Eighth, I Am!Second verse same as the first!I'm Henery The Eighth, I Am! Henery The Eighth, I Am, I am!I got married to the widow next door,She's been married seven times before.And ev'ryone was a Henery,She wouldn't have Willie or a Sam.I'm her eighth old man named Henery,Henery the Eighth, I Am!H-E-N-E-R-Y Henery, Henery, Henery The Eighth, I AM. I am!

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

Write a program that reads the text file's contents and calculates and outputs the following in this order:

 

• The number of words in the file

• The number of lines in the file

• The number of uppercase letters in the file

• The number of lowercase letters in the file

• The number of digits in the file

• The number of letter H's in the file

• The number of whitespace characters in the file

 

NOTE: Your program should include at least one try-except error handling statement block. Your program should also validate any input that could cause your program to crash.

I'm Henery The Eighth, I Am! Henery The Eighth, I Am, I am!
I got married to the widow next door,
She's been married seven times before.
And ev'ryone was a Henery,
She wouldn't have Willie or a Sam.
I'm her eighth old man named Henery,
Henery the Eighth, I Am!
Second verse same as the first!
I'm Henery The Eighth, I Am! Henery The Eighth, I Am, I am!
I got married to the widow next door,
She's been married seven times before.
And ev'ryone was a Henery,
She wouldn't have Willie or a Sam.
I'm her eighth old man named Henery,
Henery the Eighth, I Am!
H-E-N-E-R-Y Henery, Henery, Henery The Eighth, I AM. I am!

AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning