Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Build a terminal version of the game called Pig. This is a game that uses a single, 6-sided die. The purpose of the game is

Build a terminal version of the game called Pig. This is a game that uses a single, 6-sided die. The purpose of the game is to be the first person to reach 100 points. Players take turns and the first player is selected randomly. That player will throw a die and score as many points as the total shown on the die provided they did NOT roll a 1. The player may continue rolling and accumulating points (but taking the risk of getting a 1) or end their turn.

When a player rolls a 1, their turn is over. They lose all points accumulated from that turn and they pass the die to the next player.

Play passes from player to player until someone reaches or exceeds 100 points. The first player to do so is the winner and ends the game.

Rolling should generate randomly numbers 1, 2, 3, 4, 5, or 6.

In this program , the user will play against the computer. When it is the user's turn, allow them to choose to continue to roll or end their turn after every roll. When setting up the computer's play, give the computer a 1/5 chance of choosing to ending its turn after every roll. This should be independent of the points in the round.

Use at least 3 DIFFERENT java files to create the program: a driver file, an interface file, and a mechanics file. The mechanics file should only consist of methods related to scoring and win/loss counts. The interface file should consist only of methods related to printing information for the user and taking in information (but it can call information from the mechanics file). The driver file should call up methods of the interface

Do not use arrays , All attributes are private and methods need to be commented

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Demystifying Databases A Hands On Guide For Database Management

Authors: Shiva Sukula

1st Edition

8170005345, 978-8170005346

More Books

Students also viewed these Databases questions

Question

LO5 Describe job analysis and the stages in the process.

Answered: 1 week ago