In this assignment, you need to write a Java program that: • reads an ASCII text file, and asks the user the maximum # o

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

In this assignment, you need to write a Java program that: • reads an ASCII text file, and asks the user the maximum # o

Post by answerhappygod »

In This Assignment You Need To Write A Java Program That Reads An Ascii Text File And Asks The User The Maximum O 1
In This Assignment You Need To Write A Java Program That Reads An Ascii Text File And Asks The User The Maximum O 1 (112.13 KiB) Viewed 30 times
In this assignment, you need to write a Java program that: • reads an ASCII text file, and asks the user the maximum # of characters to read (say X). As for reading the input file, you should implement your program // Call below reads text file into a very long string with line breaks lines = readTextFile(args[0]); • If the number of characters in the file is greater than X, then the program should display an error message. X should be an input entered at run time. Beware of bad input from the user. • On the console, the program should print out the following statistics: 1. Total Number of words in the file. A word is a sequence of letters. 2. Total Number of numbers in the file. A number is a sequence of digits. 3. Total Number of characters including spaces (but no line breaks). 4. Total Number of spaces (any whitespace, but no line breaks). 5. Total Number of punctuations characters (e.g. ".", "!", ";", etc.) 6. Total Number of characters in upper case. 7. Total Number of characters in lower case. • On the console, the program then to print out the content of the file in reverse order while converting all letters to lower case.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply