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

Assignment Help:

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".


Related Discussions:- Write a program that predicts users age

I want to convert atmel c code into arduino mppt, Normal 0 fals...

Normal 0 false false false EN-US X-NONE X-NONE

What is the main advantage to using a data file, Problem: (a) What is ...

Problem: (a) What is the main advantage to using a data file? (b) What is meant by opening a data file? How is this accomplished? Illustrate your answer clearly with a sui

Linking source code in vc++ 6.0, i have a project in BDD(Binary Decision Di...

i have a project in BDD(Binary Decision Diagram).. where i have to use BDD library...i m using cudd package which uses BDD technique...i download cudd package..try to run in vc++ 6

Introduction to c, All languages are divided into six sections: - variables...

All languages are divided into six sections: - variables, I/O maths, conditional expressions, arrays, functions, subroutines and file handlers. Learning a software language is simi

Pointer to function, Pointer to function: int mul(int a, int b, int c) ...

Pointer to function: int mul(int a, int b, int c) {   return a*b*c; } void main() {   int (*function_pointer)(int, int, int);   function_pointer = &mul;

C program for reverse the word in string, C Program for REVERSE THE WORD IN...

C Program for REVERSE THE WORD IN STRING #include conio.h> #include stdio.h> #include string.h> void main() {           char a[50],b[25][25],temp;           i

Program, fine the class bankAccount to implement the basic properties of a ...

fine the class bankAccount to implement the basic properties of a bank account. An object of this class should store the following data: Account holder''s name (string), account nu

Wap to print series from 1 to 10 & find its square and cube, WAP TO PRINT S...

WAP TO PRINT SERIES FROM 1 TO 10 & FIND ITS SQUARE AND CUBE # include stdio.h> # include conio.h> # include math.h>   void main () { int a=1,sqr=0,cube=0;

Functions, write a program to calculate gross salary and net salary using h...

write a program to calculate gross salary and net salary using hra da pf in c++

Write Your Message!

Captcha
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