Question: In Java, RandomStringBuilder Remember the required import statements. This program can be done completely in the main method: Create a Scanner to read input from
In Java,
RandomStringBuilder
Remember the required import statements.
This program can be done completely in the main method:
Create a Scanner to read input from the keyboard.
Read in the length of an array of type StringBuilder
Create the StringBuilder array
Create a Random object with a seed of 5.
For each cell in the StringBuilder array
Create a new StringBuilder with an empty String
Use the Random object to generate a number of characters from 5 to 15 inclusive
For each character
Generate an int from 35 to 122
Convert the generated into its corresponding ASCII (Unicode) character
Append the character to the StringBuilder
End Loop
End Loop
Use the enhanced for loop to print out each StringBuilder referred to in the StringBuilder array
Sample input/output
Please enter the number of StringBuilder Objects to create: 7
/MC]@
Nm4rRV;
uMRD$
([/t-'
>3tgp4^)%bL
'v1@8
We8V(8[hBs6?n2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
