Java Code

A Game of 21
Write a program that uses the Die class that was presented in Chapter 4 to write a program
that lets the user play against the computer in a variation of the popular blackjack card
game. In this variation of the game, two six-sided dice are used instead of cards. The dice
are rolled, and the player tries to beat the computer’s hidden total without going over 21.
Here are some suggestions for the game’s design:
● Each round of the game is performed as an iteration of a loop that repeats as long as
the player agrees to roll the dice, and the player’s total does not exceed 21.
● At the beginning of each round, the program will ask the user whether he or she wants
to roll the dice to accumulate points.

● During each round, the program simulates the rolling of two six-sided dice. It rolls
the dice first for the computer, and then it asks the user if he or she wants to roll. (Use
the Die class that was demonstrated in Chapter 4 to simulate the dice).
● The loop keeps a running total of both the computer and the user’s points.
● The computer’s total should remain hidden until the loop has finished.
● After the loop has finished, the computer’s total is revealed, and whoever the player
with the most points without going over 21 wins.

Additional requirements:

Solution, must be object oriented design remonstrated with a driver.
Welcome the user with a message that you read from a file called “input.txt”.
Write the results of the game to the terminal and also to the output file called, “output.txt” and remind the user to look at that file if he/she wants to.
You only need to submit the designs, input/output files ( if applicable ) source code ( .java and not the project or the .class ) files of all the classes you’ll implement and the driver program for the problem. ( Do not submit the whole project folder and irrelevant files. )

All papers are written by ENL (US, UK, AUSTRALIA) writers with vast experience in the field. We perform a quality assessment on all orders before submitting them.

Do you have an urgent order?  We have more than enough writers who will ensure that your order is delivered on time. 

We provide plagiarism reports for all our custom written papers. All papers are written from scratch.

24/7 Customer Support

Contact us anytime, any day, via any means if you need any help. You can use the Live Chat, email, or our provided phone number anytime.

We will not disclose the nature of our services or any information you provide to a third party.

Assignment Help Services
Money-Back Guarantee

Get your money back if your paper is not delivered on time or if your instructions are not followed.

We Guarantee the Best Grades
Assignment Help Services