Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Today you are to write a program that will accept a single word from a user, which you store in a String variable. With

 

Today you are to write a program that will accept a single word from a user, which you store in a String variable. With the use of loops and nested loops you are to produce a specific pattern with the characters of the word as illustrated in the figures below. So after initializing your variables, you are to retrieve a single word String input from the user and then find the appropriate combination of for loops to display each character exactly as displayed in the two samples below. Your code must work no matter what word the user enters. The box below illustrates how your program should behave and appear. REMEMBER in the output: is a space, is a tab and is a new line. Text in green is user input Enter a string: Julien. J J u 1-> i-> e- n u 1- i e n 1-> i e n L i-> e- n L e-> n L n L e-> n-> 7 i-> e-> n 1-> i-> e-> n-> J 1-> i e- n n 1- i e n L Enter a string: Maya.J M a-> y a L a-> y a-> a a-> a y a>> M a y a>> Note 1: You are to expect a perfect user who will always enter 1 word; that is, 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: You may need more than one nested loop to solve the problem. Note 4: Final thought, remember that your solution is case-sensitive and space-sensitive and fulfill the above instructions carefully and preciselv.

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

Computer Architecture A Quantitative Approach

Authors: John L. Hennessy, David A. Patterson

6th Edition

0128119055, 978-0128119051

More Books

Students also viewed these Programming questions