Hi A game is played in which a single dice is tossed. If the result is 4 or 6, the player wins. If the result is 1 or 3, the player loses. If the result is 2 or 5, the player continues to roll the...


Hi


A game is played in which a single dice is tossed. If the result is 4 or 6, the player wins. If the result is 1 or 3, the player loses. If the result is 2 or 5, the player continues to roll the dice until a win or a loss occurs. A complete C++ function game() is given below, re-write the function with switch-case statement.


void game (int roll)<br>if ((roll ==<br>1) || (roll == 3))<br>cout << roll<br>www<br>くく<br>You LOSE

Extracted text: void game (int roll) if ((roll == 1) || (roll == 3)) cout < roll="" www="" くく="" you="" lose="" "="">< endl;="" else="" if="" ((roll="=" 4)="" ||="" (roll="=" 6))="" cout="">< roll="" ww="" くく="" -="" you="" win="" "="">< endl;="" wwww="" else="" cout="">< roll="" wwwm="" くく="" 1="" roll="" again="" "=""><>

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here