Project #39573 - C++

1-

Create a program that asks a user to enter in a number between 1 and 10, then prints out what number they entered in.

Notes:

• You need to place an end line (endl) at the end of each of your outputs
• Do not check to see if the number the user entered in is between 1 and 10

The text of your program needs to be exatly as follows (the second line is the user's input, this will vary depending on the number the user enters):

Enter in a number between 1 and 10

4

You entered in 4

-------------------------------------------------------------------------------------------------------------------------------------------------------------

2-

Create a program that asks the user the following:

What is The Answer to the Ultimate Question of Life, the Universe, and Everything?

If the user enters in 42, then output:

You are correct

If the user enters anything else then output:

Nope

----------------------------------------------------------------------------------------------

3-

The purpose of this exercise is to introduce you to some of the basics of C++ programming.

In this exercise, you will implement a simple number guessing game. The computer will randomly select a number between one and ten, your player will enter a guess, your program will compare the two numbers, and if the player guessed correctly she or he wins.

Requirements:

1. [10 points] your program source code includes your name and the project name and number
2. [10 points] your program source code is neatly and consistently formatted (type gg=G in vim to format your code)
3. [15 points] your program compiles and runs without errors
4. [10 points] computer generates a random number  between one and ten (the range can be larger).
5. [10 points] prompt for and read in the player’s guess
6. [10 points] compare the player’s guess to the computer’s number
7. [10 points] display an appropriate message to the player to let them know whether they won or lost

For extra credit

1. Have the computer tell the user "higher" or "lower" if the player’s guess is higher or lower than the computer’s number
2. Allow the player select from three difficulty levels:
1. Easy 1-10, three guesses
2. Medium 1-50 four guesses
3. Hard 1-100, five guesses

 Subject Computer Due By (Pacific Time) 09/10/2014 12:00 am
TutorRating
pallavi

Chat Now!

out of 1971 reviews
amosmm

Chat Now!

out of 766 reviews
PhyzKyd

Chat Now!

out of 1164 reviews
rajdeep77

Chat Now!

out of 721 reviews
sctys

Chat Now!

out of 1600 reviews

Chat Now!

out of 770 reviews
topnotcher

Chat Now!

out of 766 reviews
XXXIAO

Chat Now!

out of 680 reviews