I am new to c++ and I'm kinda struggling. I'm trying to write a program to guess a number that the user inputs. The program should guess a number then the user should be prompted if it is too high or too low. then the program should guess again, intill it gets it right. Then display "I guessed your number of ( lets say 37) in (lets say 5) tries" it should always guess the users number in 7 tries or less. So first the user is prompted to pick a number between 1 and 100, then the computer should guess the number, the first guess should always be 50, the user is then asked if this is too high or too low or correct, then if high the computer should guess 75, then the user should be prompted again is the number high low or correct, so basically every time the computer guesses it should be between the last guess and the maxguess. once the user has indicated that the guess is correct the program should display "I guessed your number of " " in " " guesses!
Here is some pseudo code for the program
numberofTries 1
guess 50
highLowResponse
usersNumber
minGuess 0
maxGuess 100
prompt user for mumber
retrieve userNumber
check guess
if no match
numberofTries increment
ask if high or low
get highLowResponse
if high
maxGuess gets set to current guess
new guess is guess/2 + minGuess
if low
minGuess gets set to current guess
new guess is maxguess - guess/2
output guess and number of tries
So what i need is some help with the program itself and I would like to thank all of you in advance for your help. :)