Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Project 2 Instructions This is a java project please make sure the java code gives out the same output as the sample below. A

Java Project 2 Instructions
This is a java project please make sure the java code gives out the same output as the sample below. A pangram is a phrase or sentence that contains every letter in the alphabet at least once. For your
second project, you will write a program to assist a user in creating their own pangram. To begin, print a
welcome message and read in all words in the file words.txt to create your dictionary. Do not read the
file again later in your program. Also, add the words a and I to your dictionary as the provided file
does not include single-letter words.
Then, repeat the following steps until the pangram contains every word in the alphabet:
1. Display the pangram created so far. If this is the beginning of the program, it will be empty.
2. Ask the user to enter a word in uppercase (or help for suggestions) and get the word from the
user.
3. If the user enters something other than help, check whether it is in the dictionary. If so, add it
to the pangram; if not, print an error message.
4. If the user enters help:
a. Find all the words in the dictionary containing the maximum number of distinct letters
not already present in the pangram.
b. If there are at least five such words, print five of them (without repeats in a random
order).
c. If there are not five such words, print all of them in a random order, then print random
words from the dictionary (allowing repeats) until you have printed five words.
You will not be graded on efficiency. However, you will be graded on coding style, including good
variable and method names, proper indentation, sufficient comments, and following the DRY (dont
repeat yourself) principle.
THIS IS THE OUTPUT SAMPLE:
Welcome to Pangram Maker!
Your pangram so far is:
Enter the next word (in all uppercase) or enter help for suggestions: THE
Your pangram so far is: THE
Enter the next word (in all uppercase) or enter help for suggestions: QUICK
Your pangram so far is: THE QUICK
Enter the next word (in all uppercase) or enter help for suggestions: BROWN
Your pangram so far is: THE QUICK BROWN
Enter the next word (in all uppercase) or enter help for suggestions: FOX
Your pangram so far is: THE QUICK BROWN FOX
Enter the next word (in all uppercase) or enter help for suggestions: JUMPS
Your pangram so far is: THE QUICK BROWN FOX JUMPS
Enter the next word (in all uppercase) or enter help for suggestions: OVER
Your pangram so far is: THE QUICK BROWN FOX JUMPS OVER
Enter the next word (in all uppercase) or enter help for suggestions: A
Your pangram so far is: THE QUICK BROWN FOX JUMPS OVER A
Enter the next word (in all uppercase) or enter help for suggestions: LAZY
Your pangram so far is: THE QUICK BROWN FOX JUMPS OVER A LAZY
Enter the next word (in all uppercase) or enter help for suggestions: DOG
Your pangram is complete!
THE QUICK BROWN FOX JUMPS OVER A LAZY DOG
Total Words: 9
Total Letters: 33
Welcome to Pangram Maker!
Your pangram so far is:
Enter the next word (in all uppercase) or enter help for suggestions: I
Your pangram so far is: I
Enter the next word (in all uppercase) or enter help for suggestions: WENT
Your pangram so far is: I WENT
Enter the next word (in all uppercase) or enter help for suggestions: TO
Your pangram so far is: I WENT TO
Enter the next word (in all uppercase) or enter help for suggestions: THE
Your pangram so far is: I WENT TO THE
Enter the next word (in all uppercase) or enter help for suggestions: MARKETT
That's not a valid word!
Your pangram so far is: I WENT TO THE
Enter the next word (in all uppercase) or enter help for suggestions: MARKET
Your pangram so far is: I WENT TO THE MARKET
Enter the next word (in all uppercase) or enter help for suggestions: TO
Your pangram so far is: I WENT TO THE MARKET TO
Enter the next word (in all uppercase) or enter help for suggestions: BUY
Your pangram so far is: I WENT TO THE MARKET TO BUY
Enter the next word (in all uppercase) or enter help for suggestions: help
QUADRIPLEGICS
SUPERCIVILIZED
SUPERFICIALIZED
OVERSPECIALIZED
QUADRAPLEGICS
Your pangram so far is: I WENT TO THE MARKET TO BUY
Enter the next word (in all uppercase) or enter help for suggestions: QUADRIPLEGICS
Your pangram so far is: I WENT TO THE MARKET TO BUY QUADRIPLEGICS
Enter the next word (in all uppercase) or enter help for suggestions: help
FLUVOXAMINES
FIXATIVES
FOXGLOVES
SUBJECTIVIZES
FLUXIVE
Your pangram so far is: I WENT TO THE MARKET TO BUY QUADRIPLEGICS
Enter the next word (in all uppercase) or enter help for suggestions: FOXGLOVES
Your pangram so far is: I WENT TO THE MARKET TO BUY QUADRIPLEGICS FOXGLOVES
Enter the next word (in all uppercase) or enter help for suggestions: help
JASPERIZED
JEOPARDIZE
JAZZBO
REJUVENIZED
JAPANIZE
Enter the next word (in all uppercase) or enter help for suggestions: AND Your pangram so far is: I WENT TO THE MARKET TO BUY QUADRIPLEGICS FOXGLOVES AND
Enter the next word (in all uppercase) or enter help for suggestions: help
JOURNALIZE
ZABAJONE
MUZJIK
JEEZELY
OBJECTIVIZED
Your pangram so far is: I WENT TO THE MARKET TO BUY QUADRIPELEGICS FOXGLOVES AND
Enter th enext word (in all uppercase) or enter help for suggestions: MUZJIK
Your pangram is complete!
I WENT OT THE MARKET TO BUY QUADRAPLEGETICS FOXGLOVES AND MUZJIK
Total Words: 11
Total Letters: 52

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

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions