Lab 25

Advanced Rock Paper Scissors Game

 

Objective:

 

Write one interface and three classes which will make a rock paper scissors game.  First download the driver.

The interface named RPSPlayerInterface will have the following methods

The next class RPSPlayer implements this interface

Next write the class RPSHumanPlayer which inherits from RPSPlayer

Next write the class RPSComputerPlayer which also inherits from RPSPlayer

 

 

Lab Report

  1. Draw the UML Class diagram for this project
  2. Is it possible to implement more than one interface?

 

Example Dialog:

Welcome to the rock paper scissors game!

Enter either "rock", "paper", or "scissors" to compete

rock

You picked rock

The computer picked paper

You lose!

You have 0 points

The computer has 1 points

Press enter to continue or enter "quit" to quit

 

Enter either "rock", "paper", or "scissors" to compete

paper

You picked paper

The computer picked scissors

You lose!

You have 0 points

The computer has 2 points

Press enter to continue or enter "quit" to quit

 

Enter either "rock", "paper", or "scissors" to compete

scissors

You picked scissors

The computer picked paper

You win!

You have 1 points

The computer has 2 points

Press enter to continue or enter "quit" to quit

 

Enter either "rock", "paper", or "scissors" to compete

dynamite

Incorrect choice

You picked none

The computer picked paper

You lose!

You have 1 points

The computer has 3 points

Press enter to continue or enter "quit" to quit

quit

Good bye

Finally:

Upload all the files to the dropbox