Question

IN JAVA ONLY - Please do not copy answers from similar question; those solutions DON'T work.

1. Write a hangman’s program where the user is a computer that has to guess the word “JAVA.” The computer uses a BRUTE FORCE method.

a. First write the program that shows (prints) each guess (the letter) and also draws the result (line by line, circle by circle) when the guess is wrong.

b. What does the brute force method do exactly?

c. The computer should draw both the gallows and the victim. The gallows and hapless victim look SIMILAR to this:

SOLUTION MUST DRAW A SIMILAR PICTURE BELOW WHEN GUESS IS INCORRECT!

oo@

c. Why does the computer win every time if the word is JAVA?

d. Look at the following list of words and determine ahead of time if the computer would win. Then prove our conclusion by running your program

Word List:

ADA

COBOL

LOGO

PEARL

BASIC

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution: seiccting the andom woad om the and kt the uwoad to guase pivate stotic inl count bl vobiable h holds ho e stolic sie ooP unti the counl is less than a and thre staino axe \ in the sla s toile (ount stos contains the no of chazact er in the12 Ihe rompulex guessed lollo is in the u) tru) sta6 +.quess choXAtCo), l assign guessed charteγ or i rol ronta ing ง İhenPublic slolic void hongma npieho the Picr acro adinglg the counl Volue is Ccount1) System, oul.ръі n LI n ( u35ong guess ,tSyslem.oul point in ) if (count 3) System, ou t .psintin(wǒong guess by again System out paintin (- -- Syslem out paintln(6 yclem aut paintin(cosong gue ss. lay aga:n System.oul.paintin( Ⅲ ). Systrm out. paintin(N, , Systemout Paintin) Systa) Syste oul pain) stern . out,paintin ( }ry; System out paint tn; System oul Paint In( 1 /1); (Count :: Sylemout paint in

Add a comment
Know the answer?
Add Answer to:
IN JAVA ONLY - Please do not copy answers from similar question; those solutions DON'T work. 1. W...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT