C++ language
You will create a Hangman class.
Possible private member variables:
int numOfCharacters; //for the secret word
char * secretWord;
char *guessedWord;
public:
//please create related constructors, getters, setters,constructor()
constructor()
You will need to initialize all member variables including the two dynamic variables.
destructor()
Please deallocate/freeup(delete) the two dynamic arrays memories.
guessALetter(char letter)
1.the function will check if the letter guessed is included in the word.
2. display the guessed word with related field(s) filled if the letter guessed matches the some of the letters of the word
gameResult()
1. Display how many times guessed so far
2. Display how many times with the wrong letter guessed3. Display "you win" if all letters are filled in the guess word4. Display "you lost" if the times of guessing the wrong letter reaches 6 (Note: 6 body parts - head, body, left arm, right arm, left leg, right leg)
main()
Instantiate an object of Hangman.Ask the host: how many letters in the guess word.
Ask the host: what is the guess word?
Design a loop for the player to play the guess game
1. The loop should exit if the number of wrong guess reaches 6
2. inside the loop, there should be a condition to allow the player to exit, say "Do you want to continue playing (y|n)?". If the user chooses 'n', exit the loop.
3. Inside the loop, you may do some function chaining calls, something like:
obj.guessALetter(guessLetter).gameResult()
In: Computer Science
Code in Java, Use both Set and TreeSet in only one main to show the differences between the Set and TreeSet that Set still remove the duplicate but won't sort the elements.
Create a class named DictionaryWord as:
|
DictionaryWord |
|
- word: String
|
|
+ DictionaryWord (String word, String meanings) |
Write a program with the following requirements:
Creates 8 DictionaryWord objects with:
|
word |
meanings |
|
bank robber |
Steals money from a bank |
|
burglar |
Breaks into a home to steal things |
|
forger |
Makes an illegal copy of something |
|
hacker |
Breaks into a computer system |
|
hijacker |
Takes control of an airplane |
|
kidnapper |
Holds someone for ransom money |
|
mugger |
Attacks and steals money from someone |
|
murderer |
Kills another person |
Displays all DictionaryWord with the format as:
---------- Set -----------------
<.<>
<>
<.<>
<>
----------- TreeSet ------------
<.<>
<>
<.<>
<>
Where: <>=1,2…
Hint:
In: Computer Science
Code in Java, Use both Set and TreeSet to show the differences between the Set and TreeSet that Set still remove the duplicate but won't sort the elements.
Create a class named DictionaryWord as:
|
DictionaryWord |
|
- word: String
|
|
+ DictionaryWord (String word, String meanings) |
Write a program with the following requirements:
Creates 8 DictionaryWord objects with:
|
word |
meanings |
|
bank robber |
Steals money from a bank |
|
burglar |
Breaks into a home to steal things |
|
forger |
Makes an illegal copy of something |
|
hacker |
Breaks into a computer system |
|
hijacker |
Takes control of an airplane |
|
kidnapper |
Holds someone for ransom money |
|
mugger |
Attacks and steals money from someone |
|
murderer |
Kills another person |
Displays all DictionaryWord with the format as:
---------- Set -----------------
<.<>
<>
<.<>
<>
----------- TreeSet ------------
<.<>
<>
<.<>
<>
Where: <>=1,2…
Hint:
In: Computer Science
A concordance is a table that tells how often a word appears in a text (or where in a text it appears; but we are not using this definition).
You are going to write a program for a concordance that:
The next step in writing this program is to write the Concordance class with:
To simplify the assignment, assume that a word is any collection of consecutive characters separated by white space.
Your input should be a text file (or equivalent) and your output should be a listing of the words (in alphabetical order) and the number of times that they appear in the input.
You will submit a program listing (properly commented), your sample document (at least 40 lines of text) and the print-out.
In: Computer Science
Java - Create a program that simulates a slot machine. When the program runs, it should do the following: - Ask the user to enter the amount of money he or she wants to enter into the slot machine. - Instead of displaying images, have the program randomly select a word from the following list: Cherries, Oranges, Plums, Bells, Melons, Bars (To select a word, the program can generate a random number in the range of 0 through 5. If the number is 0, the selected word is Cherries, if the number is 1, the selected word is Oranges, and so forth. The program should randomly select a word from the list three times and display all three of the words.) - If none of the randomly selected words match, the program informs the user that he or she has won $0. If two of the words match, the program informs the user that he or she has won two times the amount entered. If three of the words match, the program informs the user that he or she has won three times the amount entered. - The program asks if the user wants to play again. If so, these steps are repeated. If not, the program displays the total amount of money entered into the slot machine and the total amount won.
If you could just take a screen shot of the actual code on java that would be great. A lot of the characters appear differently when answer is copied and pasted on answer forum.
In: Computer Science
Is the word "universe" supposed to be capitalized as a proper noun?
In: Other
What does the word yield mean? Explain
In: Operations Management
In: Anatomy and Physiology
In: Economics
Amishi had a tax liability of $5,985 last year. In addition, she owed other taxes of $733. She was entitled to tax credits of $648 and withholding amounted to $480 per month.
Calculate the amount of the refund or the amount of additional taxes due (as the case may be).
Enter this amount followed by the word 'Refund' or the word 'Due'. Example: 822 Due
In: Accounting