Create a simple number guessing game

Assignment Help C/C++ Programming
Reference no: EM132084387

Number Guessing Game

Here is the question in its entirety, but the actual problem is at the end. I just felt that I would give an overview of what I am asking. The program has to be in c++ (.cpp) and must compile as such. I use linux.

This project introduces you to the basics of C++ programming.

Create a simple number guessing game. Before the game starts, your program will randomly select a number between one and ten. When the game begins ask the player "Guess the computer's number: ". The player is allowed a single guess. Accept the guess as input. Your program will compare the random number with the guess.

If the guess is correct, tell the player "You, guessed correctly! You win!".

If the guess is wrong, tell the player "I'm sorry, that is not correct. You lose."

Allow the player to select the difficulty level (easy, medium, or hard) which affects the range of the random number and the number of guesses the player is allowed:

Easy: 3 guesses, random number between 1 and 10

Medium: 4 guesses, random number between 1 and 50

Hard: 5 guesses, random number between 1 and 100

With each guess the player is told whether the random number is "higher" or "lower".

Reference no: EM132084387

Questions Cloud

Write a mars program that can perform conversions : Write a MARS program that can perform conversions between binary, decimal, and hexadecimal representations for positive integers (under 32 bits).
What earnings before interest and tax : What earnings before interest and tax (EBIT) must the firm have if it were to provide $1 per share to the shareholders? Assume perfect markets.
How to convert the ebit to free cash flow : How to convert the EBIT to free cash flow for the next 12 years?
Cash flow of the loan from the borrower perspective : Calculate (a) The cash flow of the loan from the borrower's perspective (b) The amount of the annual principal repayment (c) The stream of interest payments
Create a simple number guessing game : Create a simple number guessing game. Before the game starts, your program will randomly select a number between one and ten.
What is the investor two year holding period return : These funds increased by 20% over the next year. The investor then closed his account. What is the investor's two year holding period return?
Can polynomial time approximation algorithms can be used : Can polynomial time approximation algorithms (like the ones we learned in this module) can be used in a similar way?
What is the treynor measure of excess returns : If the portfolio return is 10 percent and the U.S. T-bill rate is 5.75 percent what is the Treynor measure of excess returns?
Calculate the expected cash collections : On average, 60% of credit sales are paid for in the current month, 20% in the next month, and the remainder in the month after that.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  What will be the contents of the list after the function

The following c function takes a singly linked list of integers as a parameter and rearranges the elements of the list the function is called with the list containing the integers 1,2,3,4,5,6,7 in the given order what will be the contents of the list..

  Create a derived class that represents a specific group

Create a derived class that represents a specific group or family of animals, and derive from that another class that represents an even more specific family or an individual species

  Prepare a program to palindrome function.

A palindrome is a string whose reversal is identical to the original string.  How many strings using decimal digits (0,1,2,.....,9) of length n are palindromes?

  Recursive function returns number of vowels in a string

Write a recursive function, vowels, that returns the number of vowels in a string and write a program to test your function.

  Determine the meaof the numbers in the array

Determine the mean(average) of the numbers in the array, and output the reslt. Use a subprogram to input the numbers, a function to find the mean.

  Write a program that calculatesand displays the distance

Distance per Tank of GasA car with a 20-gallon gas tank averages 21.5 miles per gallon when driven in townand 26.8 miles per gallon when driven on the highway.

  Explain the error-handling pathways

Using Microsoft Visio or an open source alternative such as Dia, update the diagram to include two (2) error-handling pathways.

  Create a roulette game

Create the programs in C++ that perform the purpose described and show the sample output - Create a .cpp program that verifies the strength of a password that a user is entering is strong

  Write a value-returning function

Write a program that uses the function isNumPalindrome given(Palindrome Number). Test your program on the following numbers: 10, 34, 22, 333, 678, 67876, 44444, and 123454321.

  Write recursive and iterative versions of functions

Write recursive and iterative versions of functions that compute the sum of components of an array.

  Rationalnumber class a rational number is a number that can

rationalnumber class a rational number is a number that can be represented as the quotient of two nbspintegers. for

  Write statements to prompt for and read

Write statements to prompt for and read the user's full name using a Scanner variable.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd