COMP 14-090 Summer I 2000

Assignment 4: Rock-Paper-Scissors Game

Assigned: Thursday, June 1
Due: Tuesday, June 6
Worth: 80 points

Description

Programming Project 3.11, page 171

Design and implement an application that plays the Rock-Paper-Scissors game against the computer. When played between two people, each person picks one of the three optins (usually shown by a hand gesture) at the same time and a winner is determined. In the game, Rock beats Scissors, Scissors beats Paper, and Paper beats Rock. The program should randomly choose one of the three options (without revealing it), then prompt for the user's selection. At that point the program reveals both choices and prints a statement indicating if the user won, the computer won, or if it was a tie. Continue playing until the user chooses to stop; then print the number of user wins, losses, and ties.

This solution to the problem should be modular . It should also make use of conditionals, loops, and methods.

What to Turn In

Steps to Follow

  1. Follow the instructions in Getting Started with Visual J++ under "Creating a New Project."  Use Assignment4 as your project name.
  2. Follow the instructions under "Adding a New Class."  Name your class RPSGame.
  3. Use Assignment 3 as a template for starting the code on this assignment (header comments, main method, etc.)
  4. Save often!

Notes

 


The following output window is just an example. You don't have to use the same formatting. To get black text on a white background, I pasted the captured image into the Paint program and inverted the colors.


Michele Clark
clark@cs.unc.edu

Back to COMP 14