Patrick B. answered 06/07/20
Math and computer tutor/teacher
c is a private console object and you are trying to use it in main....
either make it public, which undermines OOP
or move some of your routines into public methods in your HangMan class....
If you make it static public, then you can reference it as HangMan.c.println;
I would recommend that It would be better to rethink your design....
send me the program requirements and I can help you more with that.
Patrick B.
lol.... the computer already knows the word, so it will guess correctly every time....06/08/20
Patrick B.
when you say QUERY, that means there is a database involved; are you sure it is a database or just a flat text file?06/08/20
Patrick B.
I have uploaded some source code for you... The filename is Hangman java.txt found in the RESOUCES section on the TOOLKIT menu under this link... It contains THREE (3) files merged into one. Copy them into THREE separate files... UI_Utils.java, Hangman.java, Words.txt; make sure they are in the same folder... compile them and then run java HangMan at the command prompt.. ===================================== It is a rudimentary hangman game, but works as expected... email me if you have any questions after you study the code it should get you started06/08/20
Hanwei Z.
Yeah sure. Here is my program requirements: For the selected game, my program must provide the following features: • Player vs Computer format. • A game must consist of multiple (max 10) rounds of play. • The result of each round must be displayed to the player. • A player must be able to end the game they are playing at any time. • When a game ends the game stats of each player should be shown and the winner of game should be declared. • At the end of the game, the player must be able to start a new game or stop playing. Your program should implement: • At least one command method and one query method. • At least one array (example: tracking player/computer scores) • At least one file (example: high scores, won/lost record) • Data validation • Selection and repetition structures I have chosen to code the game hangman. Please note that I am a beginner of coding. I don't know how to use classes and private methods.06/08/20