# Search:

Type: Posts; User: iAce

1. ## Thread: [Help] How to read each column of data into a separate one dimensional array

by iAce
Replies
2
Views
303

### [Help] How to read each column of data into a separate one dimensional array

The list below has a list of stuff for my program that I need to read in. How do you read in the data column by column rather than row by row? I have to have 4 separate arrays to read in the years...

by iAce
Replies
7
Views
731

### Re: Password Generating Program Help

I meant to put randNum where it originally said in.nextInt();

if (selection == 1) // If they choose Menu Option 1, then this code below will execute.
{
while (randNum >= 97 &&...

by iAce
Replies
7
Views
731

### Re: Password Generating Program Help

It's blank. I must have made an error somewhere. I don't really know where though.

by iAce
Replies
7
Views
731

### Re: Password Generating Program Help

Something like this?

if (selection == 1)
{
while (randNum >= 97 && randNum <= 122)
{
for (int loop = 0; loop <= passLength; loop++)
{
...

by iAce
Replies
7
Views
731

I have to code a program that generates a random password for the user based on the character set they choose from. I did the code to generate the numbers (which I later have to convert to...
6. ## Thread: Dice Rolling Probability - How Do I Start It Off?

by iAce
Replies
11
Views
3,501

### Re: Dice Rolling Probability - How Do I Start It Off?

Okay well here's what I have so far. I'm not sure if even this is correct. How do I display the number of times it matches for each sum?

import java.util.Random;
import java.util.Scanner;...
7. ## Thread: Dice Rolling Probability - How Do I Start It Off?

by iAce
Replies
11
Views
3,501

### Re: Dice Rolling Probability - How Do I Start It Off?

Yeah, that was a bad example. If it was only 1 roll, then it would be 100% for one combination. I think 100 rolls would be better. So, how would I code this problem?
8. ## Thread: Dice Rolling Probability - How Do I Start It Off?

by iAce
Replies
11
Views
3,501

### Re: Dice Rolling Probability - How Do I Start It Off?

I meant the user would enter in 1 as the number of rolls they want. Basically, it's like this:
-Ask the user to input how many times the dice will be rolled.
-Calculate the probability of each...
9. ## Thread: Dice Rolling Probability - How Do I Start It Off?

by iAce
Replies
11
Views
3,501

### Re: Dice Rolling Probability - How Do I Start It Off?

It's similar to what you said. I need to display the probability of how many times a combination will occur depending on how many rolls the user input.

For example, since I'm doing a 2-sided dice...
10. ## Thread: Dice Rolling Probability - How Do I Start It Off?

by iAce
Replies
11
Views
3,501

### Re: Dice Rolling Probability - How Do I Start It Off?

It's supposed to represent all the possible sums I could get from the dice. So the lowest possible number would be 2 and the highest would be 4.

If the sum on the dice is equal to the sum, then it...
11. ## Thread: Dice Rolling Probability - How Do I Start It Off?

by iAce
Replies
11
Views
3,501

### Dice Rolling Probability - How Do I Start It Off?

Just a quick question on how to start off a code on this. The program is supposed to simulate tossing a pair of 2-sided dice and determining the percentage of times each possible combination of the...
12. ## Thread: [Help] For Loops - Number Predicting Program

by iAce
Replies
3
Views
241

### Re: [Help] For Loops - Number Predicting Program

Okay thank you. That'll be a start. I kind of have an idea of how to do this now. Why does this belong in the Java Theory board? Because it's Java lol? Or because I don't actually have a code to...
13. ## Thread: [Help] For Loops - Number Predicting Program

by iAce
Replies
3
Views
241

### [Help] For Loops - Number Predicting Program

Hello, I need help with my code again. The steps below are the things I need in my code.

1. The computer should randomly pick a three digit lottery number ranging from 000 through 999.
2. Use a...

by iAce
Replies
8
Views
366

### Re: Reading Text Files Assignment [Scanner Method]

Oh wow I'm mad that it does already. I didn't even notice. I added another counter variable and the code runs perfectly now. Thanks a lot bro. Much love.

by iAce
Replies
8
Views
366

### Re: Reading Text Files Assignment [Scanner Method]

I meant like how can I make it so that each line can be read one at a time to determine if it is equal to BB, BG, GB, or GG. I don't know how to do that.

And that's another problem I have. I don't...

by iAce
Replies
8
Views
366

### Re: Reading Text Files Assignment [Scanner Method]

In Step 3, I know I'm using Scanner inFile = new Scanner(new File("test1.txt")); to read the text file while the while loop is going. It will terminate after the last line is read.

My problem is...

by iAce
Replies
8
Views
366

### Re: Reading Text Files Assignment [Scanner Method]

Thanks for the reply. Usually the errors are just variables that I haven't declared yet. Here are the things I need to code this program correctly (I think).
(1) Declare all variables.
(2) Declare...

by iAce
Replies
8
Views
366

### Reading Text Files Assignment [Scanner Method]

I'm a beginner coder in Java and I'm confused about how to code this one assignment I have. If I can get any help, then it would be fantastic. :)

I am using BlueJ.

Assignment:
Write a program...