Java Program Project

Question Description

I’m working on a java project and need a sample draft to help me learn.

I need a java program (code that I can run and/or edit as needed). It needs to be properly documented.

Program requirements:

  • The program shall read from a text file, five, 5-letter words, and make available for the program to use.
  • The program shall take each word and jumble them (scramble each word).
  • The program shall display each jumbled word and interact with the user.
  • The program shall prompt the user to take a guess at each jumbled word, one a time, so that the user can try to guess what word it is.
  • The program shall allow three attempts for each word.
  • The program shall compare the user’s input with the jumbled word and notify the user what letters and in what position they guessed.
  • The program shall include any other messages that help interact with the user.
  • The program shall be properly documented and shall explain each function in detail, and provide guidance in case the user needs to make minor modifications to variables such as the number of attempts, the number of words read, the messages, etc.

Example:.

Read Saved 5, 5-letter words from a text file and make available in the program (load into an array list or similar method)

Input text file with saved words.

Word 1= PRONG

Word 2= abcde (placeholder)

Word 3= fghijk (placeholder)

Word 4= lmnop (placeholder)

Word 5 = rstuv (placeholder)

Program:

jumbled word 1 = NGROP

Display jumbled word “NGROP”

Ask user to guess jumbled word and unjumbled the word

Compare letters entered and their positions and verify how many they got in the correct position. If they did not get the correct word at first, the program outputs “try again”, and outputs the words that they guessed correctly in the correct position, if any, or output zero words guessed. They have three guesses for each word.

Once they make three attempts for word 1, the program continues with word 2, etc., until the user has tried three times for each word. If the user guesses any of the words before their last attempt, the program should output a message confirming they guessed the word, and continue with the next jumbled word.

The program may contain as many output messages as needed to interact with the user, in order to run in accordance with the requirements at the top of the page.

The program ends when the user guesses or make all attempts to each word, until the program finishes with word 5, either by guessing or by attempting three times.

Ex. User entered

Program reads and/or stores Word 1 from text file

P

R

O

N

G

The program jumbles each word. In this example, word 1.

N

G

R

O

P

The program directs the user to input their guess. User input #1

R

O

P

N

G

Program output: Letter 4 and 5 in the correct position. Try again, etc., until they make three attempts, or guess before their third attempt.

User input #2 OR #3

P

R

O

N

G

Program output: Your guess is correct, etc. The program continues with the next word, or exits if there are no remaining words.

Or

“You did not guess word #1. Continue with the next word…” etc.

Please let me know if there are any questions. Thank you for your assistance.

Get your college paper done by experts

Do my question How much will it cost?

Place an order in 3 easy steps. Takes less than 5 mins.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *