Question: Question 2 Write a Java program that generates 16 random lowercase letters of the alphabet (range a-z inclusive) and then writes the letters to a

 Question 2 Write a Java program that generates 16 random lowercaseletters of the alphabet (range a-z inclusive) and then writes the letters

Question 2 Write a Java program that generates 16 random lowercase letters of the alphabet (range a-z inclusive) and then writes the letters to a file. Each letter in the file should be separated by a symbol with four letters per line. No line should begin or end with a symbol. The program should also write control totals on the last 2 lines of the file as follows: The second last line should show the letter(s) that was/were generated the most number of times. Include the number of times generated as per sample file output. The last line should show the letter(s) that was/were generated the least number of times. Include the number of times generated as per sample file output. Example file contents: fljirih ulg|bf ulzloh y|wm|p Generated the most number of times (2 times): fhu Generated the least number of times (0 times): a cd e ik lnqst vx For the second last line we need to print out whichever letter(s) appeared the most. If 'F' appears 4 times and all other letters are unique; just print 'F'. If 'A' was generated 8 times and 'B' was generated 8 times, print out 'A' and 'B". As there are a maximum of 16 letters being selected, there will be at 10 unused letters minimum. Question 2 Write a Java program that generates 16 random lowercase letters of the alphabet (range a-z inclusive) and then writes the letters to a file. Each letter in the file should be separated by a symbol with four letters per line. No line should begin or end with a symbol. The program should also write control totals on the last 2 lines of the file as follows: The second last line should show the letter(s) that was/were generated the most number of times. Include the number of times generated as per sample file output. The last line should show the letter(s) that was/were generated the least number of times. Include the number of times generated as per sample file output. Example file contents: fjlr|h ugbif uzloh y|wm|p Generated the most number of times (2 times): fhu Generated the least number of times (0 times): a cde ikinast vx

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!