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...
Type: Posts; User: iAce
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...
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 &&...
It's blank. I must have made an error somewhere. I don't really know where though.
Something like this?
if (selection == 1)
{
while (randNum >= 97 && randNum <= 122)
{
for (int loop = 0; loop <= passLength; loop++)
{
...
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...
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;...
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?
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...
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...
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...
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...
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...
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...
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.
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...
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...
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...
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...
Yo, I'm Ace. I'm a rookie Java coder taking an AP Comp Sci class. I hope I'll be able to get some help from this community. :)