Write a Monte Carlo simulation to estimate the payout for the game of Okapi. This game is played by rolling three dice. A payout in dollars is determined by the rolled numbers according to the following rule:

computer science

Description

1.)  Write a Monte Carlo simulation to estimate the payout for the game of Okapi. This game is played by rolling three dice. A payout in dollars is determined by the rolled numbers according to the following rule:

1. If the three numbers are the same, the player wins the sum of those three numbers.

2. If only two of the numbers are the same, the player wins the sum of the two equal numbers.

3. For three different numbers, the player wins nothing.

 

2.)  Write a program that prompts the user for a string of digits and a positive integer k ≤ 9, and outputs the greatest k-digit substring.

 

3.) Write a JavaFX application that draws the image shown below. The dimensions of the scene are 500 x 500. The drawing is formed by creating a series of centered squares, starting with a square of side length 340 and decreasing the length by 10 pixels for each smaller square, down to length 20. The fill color alternates between red and green. Red squares are rotated 45 degrees. Each square is drawn with a black border of width 4.

A picture containing shape

Description automatically generated

 

 

 


Chart, bar chart

Description automatically generated4.) Write a JavaFX application that draws a sequence of randomly colored bars rising from the bottom of the scene. The height in pixels of each bar is a random number between 50 the height of the scene. Each bar has a width of 20 pixels, and consecutive bars are separated by a gap of 10 pixels


Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.