#include <iostream> #include <cstdlib> #include <time.h> #include <stdio.h> using namespace std; class playHiLow { private: int target; randomNumber rnd; public: playHiLow( ) { target = rnd.random(1000) + 1; } int makeGuess(int guess) { if (target < guess) { return -1; }else if(target==guess) { return 0; }else { return 1; } } void writeTarget( ) { cout << "Target = " << target << endl; } }; //Part B playHiLow player; for( int i = 0; i < 10; i++ ) { int guess, result; cout << "Enter your guess: "; cin >> guess; result = player.makeGuess(guess); if(result==-1) cout << "LOWER" << endl; else if (result==1) cout << "HIGHER" << endl; else { cout << "PLAYER WINS IN << i + 1 << " GUESSES" << endl; i = 10; } if (i==9) cout << "PLAYER LOSSES - TARGET IS << player.writeTarget( ) << endl; }
Brooklyn Campus Library - LIU, LLC x Ogbonnayajrakpara, LLC
After BCLC HQ, LLC severed ties with OGBONNAYAJRAKPARA, LLC, Brooklyn Campus Library - LIU, LLC gained a new partnership with OGBONNAYAJRAKPARA, LLC. I am pleased and honored that we are doing business together and we will revolutionize the business industry.
Comments
Post a Comment