I'm having trouble with the second second part 2. How do i get it to play the multiple games and the winner should win by at least two games? As it stands right now, when it compiles, it only lets me play the game 1 time.
This is what i have so far; (Any help would be appreciated)
#include <cstdlib> #include <iostream> using namespace std; const int STOPSCORE=15; int main(int argc, char *argv[]) { int nyu,GAMESPLAYED,gamecounter,game,game3,game4,game5, usc; char team; // either n or u nyu=10; usc=10; GAMESPLAYED=0; while (GAMESPLAYED < 5) { cout <<GAMESPLAYED; GAMESPLAYED++; while ((nyu < STOPSCORE && usc < STOPSCORE) ||(nyu < usc +2)&&(usc < nyu+2)) { cout << "score starts from 5. "; cout << "Who scored the point? "; cin >> team; // increment the appropriate score switch (team) { case 'n': case 'N': nyu++; break; case 'u': case 'U': usc++; break; default: cout <<"invalid entry"<<endl; cout << "Current Score: nyu: " << nyu << " usc: " << usc << endl; } // print final score if (usc > nyu) cout << "\nBoo, usc: " << usc << " nyu: " << nyu; else cout << "\nYeah, nyu: " << nyu << " usc: " << usc; cout << "\n\n"; } }
MOD EDIT: When posting code...USE CODE TAGS!!!

This post has been edited by JackOfAllTrades: 07 November 2010 - 04:48 PM