Create a second array where you keep count

Assignment Help JAVA Programming
Reference no: EM131864915

Assignment

For this assignment, you are going to use Java Arrays to simulate spins of a Roulette Wheel.

Requirements:

• Name your program Assignment4.javaHave the program output your first and last name

• Email me your Assignment4.java file before class is scheduled to begin on 2/17.

• You will be simulating 99 spins of a "single zero" Roulette Wheel and storing each spin in an array. For each spin, you need to generate a random integer from 0 to 36.

• Create a second array where you keep count of how many times each value came up during the 99 spins. In this array, the zero element is how many spins came up zero, the first element is how many spins came up 1, etc.

• Output all 99 of your spins with 10 spins per line (last line has 9 spins). For each spin output the number and the color. Leave a space or two between each spin on the line.

• Color is calculated according to the following rules: In number ranges from 1 to 10 and 19 to 28, odd numbers are red and even are black. In ranges from 11 to 18 and 29 to 36, odd numbers are black and even are red. 0 is green. (see https://en.wikipedia.org/wiki/Roulette)

• Write a Java method that computes the color for a given spin. It should have one input parameter (the number that was spun) and return a character to the caller ('R','B', or 'G').

• Next, have your program output how many times each value (0,1,2...,36) came up during the 99 spins.

• Computer the mean or average spin.

• Compute the median spin. The median is the "middle" value of the list after the spins are sorted. We will discuss a median example in class together. You can use the java.util.Arrays.sort method to sort your array of spins.

• Note: I'm posting SortExample.java as an example of sorting an array. This will be helpful for the median!

• Note: I'm posting PrintExample.java as an example of printing the output values on the screen.

Reference no: EM131864915

Questions Cloud

Confidence interval for the same sample results : If a hypothesized value of µ falls outside a 95% confidence interval, will it also fall outside the 99% confidence interval for the same sample results?
Describe the three objects or three people or three places : Descriptive Essay Guidelines: This is a 5 paragraph essay describing the three objects or three people or three places; as all essays, it must be in MLA format.
What is the fifth deviation score : 1. A random sample of five observations is selected. The deviation scores for the first four observations are -5, 3, 1, and -2.
Define high culture and popular culture : Give 3 examples of material culture and nonmaterial culture. Distinguish between ideal value or culture and real value or culture.
Create a second array where you keep count : Create a second array where you keep count of how many times each value came up during the 99 spins.
How many distinct timing offsets of this size are : Since all IS-95 base stations use the same short code, this simplifies the acquisition procedure. How many distinct timing offsets of this size are there?
What interference would the primary service cause in service : What interference would the primary service cause in the secondary service. That is what would the signal-to-interference ratio (SIR) of the secondary user be?
Write a program that generates two n-sequences : Write a program that generates two n:-sequences of length 28 -1. Confirm that the sequences have the autocorrelation properties of m-sequences.
How does the new sequence compare with the original in : How does the new sequence compare with the original in. sequence and with a Gold sequence of the same length? Repeat the problem for m = 7 and m = 9.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Analyze a problem in an object-oriented manner

CSE1/CSE4IOO - analyze a problem in an object-oriented manner, and then design and implement an object-oriented solution that conforms to given specifications

  Create a class named purchase

Create a class named Purchase. Each purchase contains an invoice number, amount of sale, and amount of sales tax. Include set methods for the invoice number and sale amount.

  What is an illustration of a javascriptr framework in the

what is an example of a javascriptr framework? in the framework you have described what is an example of an application

  Provide a mechanism for repeating a block of code

CPS 150- Loops provide a mechanism for repeating a block of code called the loop body. We begin this lab by experimenting with while loops, the simplest form of loop code.

  Write a class named studentgrades

Write a class named StudentGrades. The constructor of StudentGrades should accept an array of student grades as its argument.

  Write a program to that finds lowest n closing dow jones

You are to write a program to that finds lowest N closing Dow Jones Industrial averages and their dates in order by closing average. The program should prompt for the number of lowest closing averages requested by the user to be output.

  Read the article titled teaching software componentization

read the article titled teaching software componentization a bar chart java bean.write a page paper in which

  Need to add arrays to the program - federal income tax

depends on the choices made by the user. You are not required to check to make sure that the user inputs a valid Roman numeral for this assignment

  Solving programming problems

Write a computer program that will figure out the total of an order when given the amount of the order ($1000) and a sales tax rate of eight percent.

  Write the string copy and string concatenation functions

Write the string copy and string concatenation functions and first version should use array subscripting, and the second version should use pointer arithmetic.

  Modify the two java application

Java application to meet these additional and changed business requirements: - The company has recently changed its total annual compensation policy to improve

  Implement the baginterface using the dynamicarray

Implement the BagInterface using the DynamicArray generic. Downlad the following Java interface and object classes and import them into your project.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd