Cash-back offer from May 2nd to 7th, 2024: Get a flat 10% cash-back credited to your account for a minimum transaction of $50.Post Your Questions Today!

Question DetailsNormal
$ 8.00

CST8110 | Assignment 3 - Gambling | Complete Solution

Question posted by
Online Tutor Profile
request

Introduction to Computer Programming - CST8110
Assignment 3 - Gambling


Rules
Assignments are expected to be done individually. However, it is ok to share ideas or discuss
with peers. Do not copy/paste or transcribe code from each other or the web. This way your
work will keep some of its originality.
1 Solitaire Dice
This assignment involves a game invented by Howard Rosenblum, the CST8110 coordinator,
which he calls Solitaire Dice.
• The game is played alone.
• The player starts with a pot of money (e.g. $100).
1. The player chooses a bet amount less than or equal to his current pot.
– Invalid amounts are ignored, the player must specify another bet amount. [1 pts]
– A bet of $0 means the player wants to quit the game. [1 pts]
2. The game will remove their bet amount from the pot. [1 pts]
3. The game will roll three 6-faced dices and display the values rolled. [1 pts]
4. The game will adjust the pot in the following order of priority:
– If all three dices have the same value, then the player wins triple their bet back.
[1 pts]
– If two of the three die have the same value, then the player wins double their bet
back. [1 pts]
– If the total of the three dice is strictly greater than 10, then the player wins their
bet back. [1 pts]
– Otherwise, the player has lost their money.
– It is not possible to get multiple results simultaneously. [1 pts]
5. The game ends automatically if the pot reaches 0. [1 pts]
• Coding Style: Variable names are sensible (i.e. meaningful). [1 pts]
• BONUS: Betting the character ? (question mark) bets a random amount of money (within
the valid range, excluding $0). [0.5 pts]
• BONUS: Betting the character ~(tilde) is considered cheating, as it adds $100 to your pot.
[0.5 pts]
• The program does not compile. [-10 pts]
1
1.1 Hints
• You can use break to exit the loop completely (e.g. when the user bets $0).
• You can use continue to skip the rest of the loop’s body (e.g. when the user bets an invalid
amount).
• You should use the && logical operator (AND) when testing for triples.
• You should use the || logical operator (OR) when testing for doubles.
1.2 Runtime Examples (the text in blue is user input)
Pot: $100
Bet amount: $100
The rolls are: 2 3 4
Better luck next time.
Get out. You are broke.
Pot: $100
Bet amount: $50
The rolls are: 5 2 4
High roll, you get your bet back.
Pot: $100
Bet amount: $50
The rolls are: 2 5 5
Double!
Pot: $150
Bet amount: $?
You randomly bet $108
The rolls are: 4 5 5
Double!
Pot: $258
Bet amount: $~
Cheat: Free Money
Pot: $358
Bet amount: $0
Take care.
What to submit
• Submit your .java file in Blackboard.
• Your programs must compile.
• If you can’t complete the assignment, submit what you have.

Available Answer
$ 8.00

[Solved] CST8110 | Assignment 3 - Gambling | Complete Solution

  • This solution is not purchased yet.
  • Submitted On 27 Dec, 2017 08:25:31
Answer posted by
Online Tutor Profile
solution
This Solution is rated A+ previously,if yo...
Buy now to view the complete solution
Other Similar Questions
User Profile
Exper...

CST8110 | Assignment 3 - Gambling | Complete Solution

This Solution is rated A+ previously,if you have any questions regarding this tutorial than you can contact me. Check your e-mail inbox to download your solution document....

The benefits of buying study notes from CourseMerits

homeworkhelptime
Assurance Of Timely Delivery
We value your patience, and to ensure you always receive your homework help within the promised time, our dedicated team of tutors begins their work as soon as the request arrives.
tutoring
Best Price In The Market
All the services that are available on our page cost only a nominal amount of money. In fact, the prices are lower than the industry standards. You can always expect value for money from us.
tutorsupport
Uninterrupted 24/7 Support
Our customer support wing remains online 24x7 to provide you seamless assistance. Also, when you post a query or a request here, you can expect an immediate response from our side.
closebutton

$ 629.35