write a Java program that will prompt for and read one word of length greater than 3 entered by the user and display the substrings of the the reverse word without the second and second to the last character, then dropping the last character of the substrings at every iteration. You should also alternate between displaying the resulting substrings in upper and lower case, starting with upper case. Be sure to use the same format and wording as in the samples run in the table below.

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

write a Java program that will prompt for and read one word of length greater than 3 entered by the user and display
the substrings of the the reverse word without the second and second to the last character, then dropping the last character of the substrings at every iteration. You should also alternate between displaying the resulting substrings in upper and lower case, starting with upper case. Be sure to use the same format and wording as in the samples run in the table below. 

You can use the loop of your choice to solve the problem. You are not allowed to use arrays.
Based on the previous specifications your program should behave and look exactly as shown in the cases below. Your program
should work for any word entered by the user, not just the ones in the samples.
Note that in the output • symbol is a space and e is a new line character. All words except for user input (in bleu) must be
exactly as indicated in the sample outputs. Any extra "spaces" and/or "new lines" will be graded a wrong answer.
Program Sample outputs
Enteroao word:4
Enteroaoword:
Danield
COMP2484
Hereoare othe substrings oof linD:4
Here are the o substrings oof 82PMC:4
LIND
82PMC4
line
82pme
LIA
82P
14
824
Niceoone!
Nice one!
Enteroa word:
Enteroaoword:
monTReale
OMIcrone
Here areothe o substrings oofoleRTnm:4
Here areo the osubstrings oofonrcIO:4
LERTNME
NRCIO4
lertne
nrcie
LERT
NRC
lere
nre
LE
Ne
14
Niceoone!
Nice one!
Note 1: You are to expect a perfect user who will always enter one word of length greater than 3, do not verify the validity
of user input.
Note 2: The use of libraries other than java.util.Scanner is prohibited. Your program must work for any string values
entered, not just the ones in the samples above.
Note 3: Final thought, remember that your solution is space-sensitive and fulfill the above instructions carefully and precisely.
Transcribed Image Text:You can use the loop of your choice to solve the problem. You are not allowed to use arrays. Based on the previous specifications your program should behave and look exactly as shown in the cases below. Your program should work for any word entered by the user, not just the ones in the samples. Note that in the output • symbol is a space and e is a new line character. All words except for user input (in bleu) must be exactly as indicated in the sample outputs. Any extra "spaces" and/or "new lines" will be graded a wrong answer. Program Sample outputs Enteroao word:4 Enteroaoword: Danield COMP2484 Hereoare othe substrings oof linD:4 Here are the o substrings oof 82PMC:4 LIND 82PMC4 line 82pme LIA 82P 14 824 Niceoone! Nice one! Enteroa word: Enteroaoword: monTReale OMIcrone Here areothe o substrings oofoleRTnm:4 Here areo the osubstrings oofonrcIO:4 LERTNME NRCIO4 lertne nrcie LERT NRC lere nre LE Ne 14 Niceoone! Nice one! Note 1: You are to expect a perfect user who will always enter one word of length greater than 3, do not verify the validity of user input. Note 2: The use of libraries other than java.util.Scanner is prohibited. Your program must work for any string values entered, not just the ones in the samples above. Note 3: Final thought, remember that your solution is space-sensitive and fulfill the above instructions carefully and precisely.
Expert Solution
steps

Step by step

Solved in 2 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