mardi 25 septembre 2018

outputting which team wins

Do_6: Check whether both the seekers score is 1. If so, print the error message as shown in the lab description (Use if) Also, set the value of isInvalid to true

     if ((t1_s == 1) && (t2_s == 1))
    cout << "Invalid seeker score" << endl;

Do_7: Check whether either of the seekers score is greater than 1. If so print the error message as shown in the lab decription. (Use if) Also, set the value of isInvalid to true

  if (t1_s > 1)
    cout << "Invalid seeker score" << endl;
else
    if (t2_s > 1)
        cout << "Invalid seeker score" << endl;

Do_8: Check whether the total points of both the team are same and both the seekers' scores are 0. If so print the error message shown in the lab decription (use if) Also, set the value of isInvalid to true

  if ((t1_total = t2_total) && (t1_s == 0) && (t2_s == 0))
    cout << "Invalid result" << endl;

Do_9: Check who is the winner using if. The team with the maximum points will win (Remember to check both: the game is valid and the maximum of the points of two teams)

   if (t1_total > t2_total)
    cout << "Team 1 won the game" << endl;
else 
        cout << "Team 2 won the game" << endl;

Aucun commentaire:

Enregistrer un commentaire