Course Solutions Uncategorized (Solved) : Include Include Using Namespace Std Int Getcomputerguess Int Findthewinner Int Main Int Us Q36117910 . . . .

(Solved) : Include Include Using Namespace Std Int Getcomputerguess Int Findthewinner Int Main Int Us Q36117910 . . . .

 

#include <cstdlib>

#include <iostream>

using namespace std;

int getComputerGuess();

int findTheWinner();

int main() {

int userChoice , computerChoice;

cout << “Game Menu n”;

cout << “_____________n”;

cout << ” 1)Rockn 2)Papern 3)Scissorsn 4)Quitn”;

cout << ” Enter your choice:”;

cin >> userChoice;

computerChoice = getComputerGuess();

  

findTheWinner( );

  

while(true){

cout << “Game Menu n”;

cout << “________________n”;

cout << ” 1)Rockn 2)Papern 3)Scissorsn 4)Quitn”;

if(userChoice == 4){

exit(0);

}

  

computerChoice = getComputerGuess();

  

findTheWinner();

  

}

return 0;

}

int getComputerGuess(){

  

return (rand()%3);

}

void findTheWinner(intuserChoice,int computerChoice){

cout << “USER’S CHOICE:n”;

switch(userChoice){

case 1 : cout << “Rockn”;

break;

  

case 2 : cout << “Papern”;

break;

case 3 : cout << ” Scissorsn”;

break;

}

  

cout << ” COMPUTER’S Choice:n”;

switch(computerChoice){

case 1 : cout << ” Rockn”;

break;

case 2 : cout << “Papern”;

break;

case 3 : cout << “Scissorsn”;

break;

}

  

if(!(userChoice >= 1 && userChoice<= 4)){

cout <<

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post