#include <iostream>
#include <time.h>
#include <conio.h>
#include <windows.h>
using namespace std;
//prototypes
void seed_random(); // Seeds random number generator
bool coin_toss(void); //
void play_end(bool& first_team, int &t1score, int &t2score);
// Main Program
int main(void)
{
int team1end1; //team ones score for first end
int team2end1; //team two score for first end
int team1end2; //team ones score for second end
int team2end2; //team two score for second end
int team1end3; //team ones score for third end
int team2end3; //team two score for third end
int team1end4; //team ones score for fourth end
int team2end4; //team two score for fourth end
int team1end5; //team ones score for fifth end
int team2end5; //team two score for fifth end
int team1end6; //team ones score for sixth end
int team2end6; //team two score for sixth
int team1end7; //team ones score for seventh end
int team2end7; //team two score for seventh end
int team1end8; //team ones score for eighth end
int team2end8; //team two score for eighth end
int team1end9; //team ones score for ninth end
int team2end9; //team two score for ninth end
int team1end10; //team ones score for tenth end
int team2end10; //team two score for tenth end
int t1score;
int t2score;
//Seed random number generator
//Initilize the variables
team1end1 = 0; //team ones score for first end
team2end1 = 0; //team two score for first end
team1end2 = 0; //team ones score for second end
team2end2 = 0; //team two score for second end
team1end3 = 0; //team ones score for third end
team2end3 = 0; //team two score for third end
team1end4 = 0; //team ones score for fourth end
team2end4 = 0; //team two score for fourth end
team1end5 = 0; //team ones score for fifth end
team2end5 = 0; //team two score for fifth end
team1end6 = 0; //team ones score for sixth end
team2end6 = 0; //team two score for sixth
team1end7 = 0; //team ones score for seventh end
team2end7 = 0; //team two score for seventh end
team1end8 = 0; //team ones score for eighth end
team2end8 = 0; //team two score for eighth end
team1end9 = 0; //team ones score for ninth end
team2end9 = 0; //team two score for ninth end
team1end10 = 0; //team ones score for tenth end
team2end10 = 0; //team two score for tenth end
t1score = 0;
t2score = 0;
// seed_random - This function seeds the random number generator using the timer
void seed_random()
{
int i; // Loop counter
// Seed the random number generator use the timer
srand((unsigned)time(NULL));
for (i = 0; i < rand(); i++)
rand();
} // seed_random
//Coin flip to determine who gets the hammer
int coin()
{
int flip;
flip = rand() % 2 + 1;// assign random numbers
if (flip == 1)
cout << " " << endl;
else (flip == 2);
cout << " " << endl;
//end if
return (flip);
}
{
while (flip = 1)
{
switch (team1end1)
{
case 1:'0'; // zero points
break;
case 2:'1'; //one point
break;
case 3:'2'; //two points
break;
case 4:'3'; //three points
break;
case 5:'4'; //four points
break;
}
}
}
#include <iostream>
#include <time.h>
#include <conio.h>
#include <windows.h>
usingnamespace std;
// prototypes
void seed_random (); // Seeds random number generator
bool coin_toss (void); //
void play_end (bool& first_team, int& t1score, int& t2score);
// Main Program
int main (void)
{
int team1end1; // team ones score for first end
int team2end1; // team two score for first end
int team1end2; // team ones score for second end
int team2end2; // team two score for second end
int team1end3; // team ones score for third end
int team2end3; // team two score for third end
int team1end4; // team ones score for fourth end
int team2end4; // team two score for fourth end
int team1end5; // team ones score for fifth end
int team2end5; // team two score for fifth end
int team1end6; // team ones score for sixth end
int team2end6; // team two score for sixth
int team1end7; // team ones score for seventh end
int team2end7; // team two score for seventh end
int team1end8; // team ones score for eighth end
int team2end8; // team two score for eighth end
int team1end9; // team ones score for ninth end
int team2end9; // team two score for ninth end
int team1end10; // team ones score for tenth end
int team2end10; // team two score for tenth end
int t1score;
int t2score;
// Seed random number generator
// Initilize the variables
team1end1 = 0; // team ones score for first end
team2end1 = 0; // team two score for first end
team1end2 = 0; // team ones score for second end
team2end2 = 0; // team two score for second end
team1end3 = 0; // team ones score for third end
team2end3 = 0; // team two score for third end
team1end4 = 0; // team ones score for fourth end
team2end4 = 0; // team two score for fourth end
team1end5 = 0; // team ones score for fifth end
team2end5 = 0; // team two score for fifth end
team1end6 = 0; // team ones score for sixth end
team2end6 = 0; // team two score for sixth
team1end7 = 0; // team ones score for seventh end
team2end7 = 0; // team two score for seventh end
team1end8 = 0; // team ones score for eighth end
team2end8 = 0; // team two score for eighth end
team1end9 = 0; // team ones score for ninth end
team2end9 = 0; // team two score for ninth end
team1end10 = 0; // team ones score for tenth end
team2end10 = 0; // team two score for tenth end
t1score = 0;
t2score = 0;
cout << "END TEAM CANADA TEAM AUSTRALIA" << endl;
cout << " 1 " << team1end1 << " " << team2end1 << endl;
cout << " 2 " << team1end2 << " " << team2end2 << endl;
cout << " 3 " << team1end3 << " " << team2end3 << endl;
cout << " 4 " << team1end4 << " " << team2end4 << endl;
cout << " 5 " << team1end5 << " " << team2end5 << endl;
cout << " 6 " << team1end6 << " " << team2end6 << endl;
cout << " 7 " << team1end7 << " " << team2end7 << endl;
cout << " 8 " << team1end8 << " " << team2end8 << endl;
cout << " 9 " << team1end9 << " " << team2end9 << endl;
cout << " 10 " << team1end10 << " " << team2end10 << endl;
cout << "--------------------------------------------------" << endl;
cout << "FINAL SCORE " << t1score << " " << t2score << endl;
} // Main
// seed_random - This function seeds the random number generator using the timer
void seed_random ()
{
int i; // Loop counter
// Seed the random number generator use the timer
srand ((unsigned)time (NULL));
for (i = 0; i < rand (); i++)
rand ();
} // seed_random
// Coin flip to determine who gets the hammer
int coin ()
{
int flip;
flip = rand () % 2 + 1; // assign random numbers
if (flip == 1)
cout << " " << endl;
else
(flip == 2);
cout << " " << endl;
// end if
return (flip);
}
{ //¿what's this supposed to be? you are outside any function
while (flip = 1)
{
switch (team1end1)
{
case 1:
'0'; // zero points
break;
case 2:
'1'; // one point
break;
case 3:
'2'; // two points
break;
case 4:
'3'; // three points
break;
case 5:
'4'; // four points
break;
}
}
}
the loop makes no sense, ¿what are you trying to do there?