Today you are to write a program that will accept a single word from a user,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Related Book For
Computer Architecture A Quantitative Approach
ISBN: 9780128119051
6th Edition
Authors: John L. Hennessy, David A. Patterson
Posted Date:
Students also viewed these programming questions
-
Python and most Python libraries are free to download or use, though many users use Python through a paid service. Paid services help IT organizations manage the risks associated with the use of...
-
Microkernel operating systems aim to address perceived modularity and reliability issues in traditional "monolithic" operating systems. (i) Describe the typical architecture of a microkernel...
-
Integer sort. Write a linear-time filter that reads from standard input a sequence of integers that are between 0 and 99 and prints to standard output the same integers in sorted order. For example,...
-
What is the amount of the quarterly deposits A such that you will be able to withdraw the amounts shown in the cash flow diagram if the interest rate is 8% compounded quarterly? $2,500 8% Compounded...
-
When we go out to dinner, we always like to park as close as possible to the restaurant. Assume the restaurant is situated on a very long street running east to west, which allows parking on one side...
-
Craxton Engineering will either purchase or lease a new $756,000 fabricator. If purchased, the fabricator will be depreciated on a straight-line basis over seven years. Craxton can lease the...
-
Damico Company's Board Division manufactures an electronic control board that is widely used in high-end DVD players. The cost per control board is as follows: Variable cost per board . . . . . . . ....
-
Marshall's concept of external economies and diseconomies refers to: a) Changes in output resulting from changes in input levels b) The effects of production on the environment c) The benefits or...
-
Show the equivalence of the following three definitions of continuity. Let (X, d) (Y, d) be two metric spaces. A function f from X into Y is said to be continuous at a = X if: (1) For each & > 0,...
-
Define both terms and outline how logistics and supply chain management differ from each other.
-
Explain the key developments behind the evolution of logistics and SCM.
-
If a prospective client hoped to accumulate $150,000 in 10 years, how much must he or she deposit today in an account that earns an annual return of 4 percent? A. -100,614.91 B. 100,614.91 C....
-
Susan and Tom have annual fixed and variable expenses of \($100,000.\) They each earn \($80,000\) for a combined earned income of \($160,000.\) Susan has a small trust fund which provides minimal...
-
Explain the origins of both logistics and supply chain management.
-
Prepare a written report based on the CAFR (financials will be obtained from the government website) of a government city that was selected. Answer the following questions: 1) Introduce and explain...
-
Imagine that your best friend knows you are taking a psychology course and wonders what psychology is all about. How would you define psychology for your friend? Write an essay on the discipline of...
-
Use the numbers for the alcohol and tobacco category from the table in the Application "Goods with a Large Consumer Surplus Loss from Price Increases" to draw a figure that illustrates the roles that...
-
Change the answer given in the Challenge Solution for the short run rather than for the long run.
-
Because many consumers choose between coffee and tea, the coffee and tea demand functions depend on both prices. Suppose the demand curves for coffee and tea are where \(Q_{c}\) is the quantity of...
Study smarter with the SolutionInn App