Write a program that predicts users age, C/C++ Programming

Write a program that predicts users age:

Write a program that predicts users' age (0-128 years old) with at most 7 questions. The game starts with asking the user whether he/she is younger or older than G (an initial guess). The user responds with 'O' for older', 'Y for 'younger' and 'X' for 'you got it!'

Start by looking up the "binary search" which is one of the most common search algorithms.

Use a while loop to ask user whether his/her age is '>', '<' or '=' the guess. Update the guess using the binary search method. Note that you are not allowed to use "break".

Posted Date: 2/14/2013 4:35:21 AM | Location : United States







Related Discussions:- Write a program that predicts users age, Assignment Help, Ask Question on Write a program that predicts users age, Get Answer, Expert's Help, Write a program that predicts users age Discussions

Write discussion on Write a program that predicts users age
Your posts are moderated
Related Questions
Which constructor gets called while I create an array of Fred objects?

Compound Assignment Operators Apart from the binary and the unary arithmetic operators, we also have compound assignment operators. These are +=, -=, *=, /=, %=. Using these op

Write a C++ program which does the following: 1. Asks the user to enter the following text "Four score and seven years ago there was a man named Joey Bagadonuts." 2. Save thi

for different operation multiple stack

How do you declare an integer variable? Explain with an example.

Increment and Decrement Operators.   The operator for increment is '++' and decrement is '-'. These operators enhances or decrease the value of a variable on which they are ope


What happens while a derived-class object is developed & destroyed? A: Space is allocated (on the heap or the stack) for the full object (i.e. adequate space to store the data m

Objective Using C++ string, classes, constructors and member functions. Task A Write a program (book.cpp) to store a list of book titles and the published dates. Your pro

Need help in network programming in C++ project. How much you charge?