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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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