Program2 - /Tom Nanke/CIS 150-001/Program 2/This program is designed so that the computer has to figure out what number the user randomly picks at

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//Tom Nanke //CIS 150-001 //10-9-07 //Program 2 //This program is designed so that the computer has to figure out what number the user randomly picks at the beginning //of the program. The user picks a number between 1 and 100, which is the input. Then the computer has to figure out what //that number is. The computer does this by finding the middle of the possible range, outputting it as a guess, and having //the user tell the computer if it's guess is too high or too low. If the guess is too low then the computer will guess //higher, picking a number in the middle of the new range. This process keeps repeating until the computer reaches the //user's original number. Once the computer figures it out, the user will enter a value letting the computer know it //successfully found the user's number, and the computer will output a congratulatory note to itself. #include <iostream> #include <time.h> #include <string> using namespace std; int MAX=100; // the max of the range that the computer will use to do its
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/25/2010 for the course CECS CIS 150 taught by Professor L.tsui during the Fall '07 term at University of Michigan-Dearborn.

Page1 / 4

Program2 - /Tom Nanke/CIS 150-001/Program 2/This program is designed so that the computer has to figure out what number the user randomly picks at

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online