CS 160 - Programming Concepts and Applications

Summer II 2018 - Lab 3D - RPS: Multigame

Quick Links: Canvas | John Cabot | Piazza | zyBooks

|   Home |  Contact |  Syllabus |  Assignments |  Schedule |  Resources   |

This lab is due by Thursday, July 12, 2018, 11:59 PM.


Make a copy of Lab3C's main.cpp and place it as the starting point for Lab3D.


Rock Paper Scissors Part IV



At the end of Lab3C, we had a fully functioning rock-paper-scissors game. Now we want to modify our game so the user can continue to play another game if they choose. We will need to wrap our code from Lab3C in a while loop until the user says they don't want to play anymore. When the user says they don't want to play again, print out a nice message thanking them for playing.

As the user continues to play, keep track of how many games the user won, lost, and tied. When the user stops playing, print out how many games were won, lost, and tied.

A sample run of the program is shown below:

Welcome one and all to a round of Rock, Paper, Scissors! (Enter P, R or S)
Player one: R

Player choose Rock
Computer choose Paper

Paper beats rock. Computer wins!
Do you want to play again? (Y/N) Y

Welcome one and all to a round of Rock, Paper, Scissors! (Enter P, R or S)
Player one: R

Player choose Rock
Computer choose Paper

Paper beats rock. Computer wins!
Do you want to play again? (Y/N) Y

Welcome one and all to a round of Rock, Paper, Scissors! (Enter P, R or S)
Player one: R

Player choose Rock
Computer choose Scissors

Rock beats scissors. Player wins!
Do you want to play again? (Y/N) N

Thanks for playing!
You won 1 game(s), lost 2 game(s), and tied 0 game(s).

Congrats! We've now fully finished our Rock, Paper, Scissors game. See how many games you can play in a row without losing to the computer!


Lab Submission



You will submit your solution to this lab with the rest of Set3. Detailed instructions for doing this are posted in Assignment 3.


This lab is due by Thursday, July 12, 2018, 11:59 PM.

Last Updated: 07/04/18 15:59


Valid HTML 4.01 Strict Valid CSS! Level Triple-A conformance, W3C WAI Web Content Accessibility Guidelines 2.0