You can use the appropriate combination of loops and nested loops 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: • is a space, → is a tab and J is a new line. 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 Enter-a word: Roman. 0&→m&→a&→J a&→J Pretty•triangle! Enter a word: 9876543.J 8&→78→6&→5&→4&J 78→68→5&→4&.d 6&→58→4&J 58→48.J 48→J Pretty triangle! Enter-a word: mOntreAl.J 0&→n&→t&→r&→e&→A&→J n&>t&→r&→e&→A&→J t&→r&→e&→A&→J A&→J Prettyetriangle! Note 1: You are to expect a perfect user who will always enter a word of a length greater than 3 (with no whitespace characters); hence 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 strings entered, not just the ones in the samples above. Note 3: Final thought, remember that your solution is case-sensitive and space-sensitive and fulfill the above instructions carefully and precisely.

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

You are to write a Java program that will prompt for and read 1 word of a length greater that 3 entered by
the user, which you store in a String variable. With the use of loops and nested loops you are to produce a specific triangular pattern with the characters of the word without the first and last characters and having: & next to each character as illustrated in the figures below, exactly as displayed in the samples below. Your code must work no matter what word the user enters.

You can use the appropriate combination of loops and nested loops 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: • is a space, → is a tab and J is a new line. 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
Enter a word: Roman.
0&>m&>a&>J
m&>a&→J
a&>J
Pretty triangle!
Enter a°word:9876543.J
8&→78→6&→5&→4&J
786&→5&→4&J
6&>5&→4&J
5&→4&J
Pretty triangle!
Enter-a word: mOntreAlJ
08>n&>t&>r&→e&→A&→J
n&>t&>r&>e&→A&>J
t&>r&>e&>A&→J
r&>e&>A&>J
e&>A&>J
A&>J
Pretty triangle!
Note 1: You are to expect a perfect user who will always enter a word of a length greater than 3 (with no whitespace
characters); hence 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 strings entered, not
just the ones in the samples above.
Note 3: Final thought, remember that your solution is case-sensitive and space-sensitive and fulfill the above instructions
carefully and precisely.
Transcribed Image Text:You can use the appropriate combination of loops and nested loops 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: • is a space, → is a tab and J is a new line. 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 Enter a word: Roman. 0&>m&>a&>J m&>a&→J a&>J Pretty triangle! Enter a°word:9876543.J 8&→78→6&→5&→4&J 786&→5&→4&J 6&>5&→4&J 5&→4&J Pretty triangle! Enter-a word: mOntreAlJ 08>n&>t&>r&→e&→A&→J n&>t&>r&>e&→A&>J t&>r&>e&>A&→J r&>e&>A&>J e&>A&>J A&>J Pretty triangle! Note 1: You are to expect a perfect user who will always enter a word of a length greater than 3 (with no whitespace characters); hence 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 strings entered, not just the ones in the samples above. Note 3: Final thought, remember that your solution is case-sensitive and space-sensitive and fulfill the above instructions carefully and precisely.
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

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