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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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