Sale!

Lab 6.2 COMP 248 Arrays & Nested Loops

$30.00 $18.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (5 votes)

Today you are commissioned to write a program that will input 5 stringsfrom a user that you store in a String array,
modify these strings and with the use of for loops and nested for loops reproduce the specific pattern illustrated
in the figures below.
Retrieve 5 words from the user (we are assuming they are at least 3 character long) and store them into an array.
Modify the strings by replacing the last letter of each word by a *. Then find the appropriate combination of for
loops to display the content of the array of strings exactly as displayed in the sample below.
REMEMBER in the output: ◦ is a space,  is a tab and ↵ is a new line. Text in green is
user input.
Note:
1. You are to expect a perfect user who will always enter strings with at least 3 characters; that is, do not
verify the validity of the user input.
2. The use of libraries other than java.util.Scanner is prohibited.
3. Final thought, remember that the solution is case and space-sensitive.
Reminder:
When submitting your solution to the lab system, make sure there is no package statement at the top of your
.java file as this will result in a grade of 0 (restriction of this system).
Enter◦5◦words:↵
aaa◦bbb◦ccc◦ddd◦eee↵
    aa* ↵
   bb* bb* ↵
  cc* cc* cc* ↵
 dd* dd* dd* dd* ↵
ee* ee* ee* ee* ee* ↵
Enter◦5◦words:↵
abcd◦efgh◦ijkl◦mnop◦qrst↵
    abc* ↵
   efg*efg* ↵
  ijk*ijk*ijk* ↵
 mno*mno*mno*mno* ↵
qrs*qrs*qrs*qrs*qrs* ↵