JAVA print a list of names in a table with a fixed-width font. Names must be alphabetized top to bottom, then left to right, and be in columns with an equal number of names, (last column can have less names). The columns can have width that is unequal but have to be as narrow as possible. Use as many columns as you can fit on the page. The size of each column is the number of characters with the longest name in the column.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
JAVA
print a list of names in a table with a fixed-width
font. Names must be alphabetized top to bottom,
then left to right, and be in columns with an equal
number of names, (last column can have less
names). The columns can have width that is
unequal but have to be as narrow as possible.
Use as many columns as you can fit on the page.
The size of each column is the number of
characters with the longest name in the column.
Columns should also be separated by a fixed
gutter of various spaces (columns separated by
g spaces), the width of the page = 1sws1000 and
the size of the gutter = 1sgs1000. If any names
have more characters than the width of the page,
then the program should print: "hello"
input should be taken from the standard input
stream (via scanner) and first line should contain
two integers separated by a space. Then the first
line should be followed by a number of names in
the form of a single string per line (names should
not contain any whitespace in them and should
continue until the end of file/standard input:
22 2
EEEEEE
DDDDDD
FFFFFF
HHHHHH
GGGGGG
The output has to be a table with one or more
columns (no header):
DDDDDD GGGGGG
EEEEEE HHHHHH
FFFFFF IIIIII
Transcribed Image Text:JAVA print a list of names in a table with a fixed-width font. Names must be alphabetized top to bottom, then left to right, and be in columns with an equal number of names, (last column can have less names). The columns can have width that is unequal but have to be as narrow as possible. Use as many columns as you can fit on the page. The size of each column is the number of characters with the longest name in the column. Columns should also be separated by a fixed gutter of various spaces (columns separated by g spaces), the width of the page = 1sws1000 and the size of the gutter = 1sgs1000. If any names have more characters than the width of the page, then the program should print: "hello" input should be taken from the standard input stream (via scanner) and first line should contain two integers separated by a space. Then the first line should be followed by a number of names in the form of a single string per line (names should not contain any whitespace in them and should continue until the end of file/standard input: 22 2 EEEEEE DDDDDD FFFFFF HHHHHH GGGGGG The output has to be a table with one or more columns (no header): DDDDDD GGGGGG EEEEEE HHHHHH FFFFFF IIIIII
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY