Questions
C++ language You will create a Hangman class. Possible private member variables: int numOfCharacters; //for the...

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...

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                                                             
- meanings: String

+ DictionaryWord (String word, String meanings)
+ getWord(): String
+ setWord (String word): void
+ getMeanings(): String
+ setMeanings(String meanings): void

Write a program with the following requirements:
Creates 8 DictionaryWord objects with:

  • Word and meanings as the table:

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

  • Ensure that there is no duplicate DictionaryWord objects (02 DictionaryWord objects a and b are equal when a.word=b.word).

Displays all DictionaryWord with the format as:

---------- Set -----------------

<.<>
<>

<.<>
<>

----------- TreeSet ------------

<.<>
<>

<.<>
<>

Where: <>=1,2…

Hint:

  • class DictionaryWord implements Comparable to order 2 DictionaryWord objects.
  • override equals(..) method to compare 2 DictionaryWord objects.
  • override toString()
  • use Set to ensure no duplicate.
  • 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

In: Computer Science

Code in Java, Use both Set and TreeSet to show the differences between the Set and...

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                                                             
- meanings: String

+ DictionaryWord (String word, String meanings)
+ getWord(): String
+ setWord (String word): void
+ getMeanings(): String
+ setMeanings(String meanings): void

Write a program with the following requirements:
Creates 8 DictionaryWord objects with:

  • Word and meanings as the table:

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

  • Ensure that there is no duplicate DictionaryWord objects (02 DictionaryWord objects a and b are equal when a.word=b.word).

Displays all DictionaryWord with the format as:

---------- Set -----------------

<.<>
<>

<.<>
<>

----------- TreeSet ------------

<.<>
<>

<.<>
<>

Where: <>=1,2…

Hint:

  • class DictionaryWord implements Comparable to order 2 DictionaryWord objects.
  • override equals(..) method to compare 2 DictionaryWord objects.
  • override toString()
  • use Set to ensure no duplicate.
  • 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

In: Computer Science

A concordance is a table that tells how often a word appears in a text (or...

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:

  • reads a text
  • separates it into words (any collection of letters appearing between non-alphabetic characters)
  • places them into a table (if they are not already there with an initial count of 1)
  • or adds one to its count in the table (if it's already there).

The next step in writing this program is to write the Concordance class with:

  1. the necessary constructor that initializes the number of installed words to zero (0)
  2. Installs additional words, by placing them at the end of the array, incrementing the count and then sorting them into order.:
  3. searches the array for a word, returning the index if the word is there and return -1 if it isn't
  4. Prints the lsit of words and the number of occurences in the text.
Your program should be modular, with separate classes for handling input/output and for the concordance.

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.



it is about java

i need to make a programming to read my input text file. input can be any word. output should contains a list of occurences of all text file’s words.

In: Computer Science

Java - Create a program that simulates a slot machine. When the program runs, it should...

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?

Is the word "universe" supposed to be capitalized as a proper noun?

In: Other

What does the word yield mean? Explain

What does the word yield mean? Explain

In: Operations Management

200-250 word paragraph on “Buddhism and science”

200-250 word paragraph on “Buddhism and science”

In: Anatomy and Physiology

300 word of Explain how to appraise employees.

  1. 300 word of Explain how to appraise employees.

In: Economics

Amishi had a tax liability of $5,985 last year. In addition, she owed other taxes of...

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