This is what i have so far. I'm supposed to simulate the 4 dice tossed 1 million times . (so a total of 4 million) I'm trying to get the first die(If I can figure out the first one then I can figure out the other 3. So the trouble I am having is that I cant get the face in the output to show the numbers I appointed in the first array die1. How do I get the numbers for die1 to show on the output. Also the frequency is way over the 1 million. How do I get it so that my frequency to stay in the 1 million range (or any other number that the user may input. Really need help for this. Its due tomorrow but I have been working hard at this for the past week. Help would be appreciated! Thank you

System.out.println("We will simulate rolling 4 different dice.");
System.out.println("This will test the hypothesis of the 'go first dice' ");
System.out.println("We will now roll the first die one million times. Please enter the number one million.");
times = input.nextInt();

You have made the arrays die1...die4 to do two things:
1. as a counter (accumulator) for the frequency, and
2. as the value of the face.
This is an impossible task, and that explains why the total adds up to more than a million.

I suggest you make the following changes:
1. Add a constant integer array, such as pips1[], to store the value of each face.
2. Initialize die1[]...die4[] to zero (which is the default in Java).
Proceed as above. Then the total should add up to 1 million.
Use the pip1[] array to show the value of faces 0-11.
Good luck!

Write a program to prompt the user to enter the cost of an item before VAT has been
added. The program should calculate and output the amount of VAT payable and the
total cost of the item including VAT.

VAT is currently charged at 20% and this should be stored as a constant in your
program.

Answer this Question

First Name:

School Subject:

Answer:

Related Questions

math - i'm supposed to make an equation going off of this problem.. it is ...