Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 17 (5 points) Write a method called inputStats that accepts a Scanner representing an input file and reports the number of lines, the longest

image text in transcribed

Exercise 17 (5 points) Write a method called inputStats that accepts a Scanner representing an input file and reports the number of lines, the longest line, the number of tokens on each line, and the length of the longest token on each line. If the file contains the following text: Beware the Jabberwock, my son. the jaws that bite, the claws that catch. Beware the JubJub bird and shun the frumious bandersnatch. For the input above, your method should produce the following output: Line 1 has 5 tokens (longest = 11) Line 2 has 8 tokens (longest = 6) Line 3 has 6 tokens (longest = 6) Line 4 has 3 tokens (longest = 13) Longest line: the jaws that bite, the claws that catch

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

What Is A Database And How Do I Use It

Authors: Matt Anniss

1st Edition

1622750799, 978-1622750795

More Books

Students also viewed these Databases questions

Question

Compare and contrast glass escalator and glass ceiling.

Answered: 1 week ago