Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Business Economics Expert

Word guessing game: 

Overview: I must create a game in which the user has a set number of tries to correctly guess a word. 

Win condition: If the user correctly guesses and reveals all of the letters, the guessing will end and print "You win" and reveal the word.

Loss condition: The user will only see a "game over" print and be revealed the word.

Required functionality:

  • Main()Should contain the following variables:
  • two arrays of chars. One array named answer to hold a word for the user to guess. the second an exact same sized char array initialized all to the "*" character
  • a constant int for size shared between the two exact same sized arrays called size
  • an int named guesses initialized to double the size of your size variable.
  • an int named revealed initialized to zero.
  • a char named guess initialized to '0'.
  • This should contain the base functionality of the game. A loop should control the game and check if guesses are greater than zero and revealed is less than size.
  • Ask the user for a guess and call check guess.
  • if check guess returns true, let the user know they revealed a letter and call revealLetter().
  • decrement guesses by one as now a turn has been consumed. This must be outside of any conditional logic above^
  • perform a check to see if revealed == size to see if the user revealed all the letters.
  • display() - This function is called anytime the contents of an array needs to be printed on the screen. This should be passed an array, and the size integer.
  • checkGuess() - This is a boolean function that will return true if a match is found in the answer array passed into it. You will need to pass the user's guess to compare, the correct answer array, and the size integer of the array.
  • revealLetter() - This void function should be passed the matching guess char, the answer array, the word array, the size of the arrays (one variable), and REFERENCE to "revealed" so it can be iterated. This function should look through the answer array and find the matching element between the user's guess and the answer array. Copy the answer element data into the word array at that exact position to simulate revealing the letter. Lastly, increment revealed.

Business Economics, Economics

  • Category:- Business Economics
  • Reference No.:- M92333052
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Business Economics

Assume that 8 of people have ab blood a hospital blood bank

Assume that 8% of people have AB blood. A hospital blood bank needs ABblood so the blood bank begins checking potential donors. Use this Excel file geometric probabilities (enable the macro after opening the file) or thi ...

Given that the heights of adult males show a mean of 69 and

Given that the heights of adult males show a mean of 69" and standard deviation 2.7." A sample of 37 adult males shows a mean of 68.2" and standard deviation of 2.9." 1. Which of the following is a statistic? a) 69" b) 2 ...

Based on your understanding of elasticity will the

Based on your understanding of elasticity, will the elasticity of demand for Honda sedans increase, decrease, or remain the same when each of the following events occurs? Explain your answer. a. Other car manufacturers, ...

Match the definitionconsumer surplusproducer surplusthe

Match the Definition Consumer Surplus Producer Surplus The difference between the amount that buyers would be willing and able to pay for a good and the actual amount the buyer pays The difference between the minimum amo ...

A medical researcher is interested in determining whether a

A medical researcher is interested in determining whether a new medication for lung cancer is effective in a group of patients with early-stage disease. Explain what a Type I and Type II error would be in this study. (Be ...

In the following five scenarios h0 alpha the obtained

In the following five scenarios, H0, α, the obtained probability (p-value), and the true status of H0 are given. Assume that our test statistic follows a standard normal distribution. Do the following: (a) State whether ...

Gregs hardware has determined the following demand and

Greg's Hardware has determined the following demand and supply equations for nails QD = 10,000-25P QS = -5,000 + 50P a. How many nails would be sold for $100? b. At what price would nail sales be zero? c. When P = $200, ...

I a survey of 400 adults that say traffic is a problem

In a survey of 400 adults that say traffic is a problem: East reported 36% is a problem, South 33% problem, Midwest 26% problem and West 55% problem. (a) The 95% confidence interval for the proportion from the West say t ...

A manufacture makes makes two models of an item model 1

A manufacture makes makes two models of an item. Model 1 which accounts for 89% of unit sales, and model 2, which accounts for 11% of unit sales. Because of defects the manufacture has to replace (or exchange) 11% of its ...

A sample of 1000 crop-eating beetles are collected and

A sample of 1,000 crop-eating beetles are collected and closed and dosed with a new pesticide. Researchers count dead beetles to measure toxicity of the pesticide, finding that 639 beetles die after being dosed. the samp ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As