No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
how would i keep adding a random integer to the end of an arraylist? the amount of random numbers to be added is not set |
|
so all i want to do is roll 1 die repeatedly and add it to a total until the total is equal to or greater than 31 this is what i have got to so far [CODE] import java.io.*; import java.util.*; public class comp { public static void main(String[] args) … |
|
ok so what i am trying to do is create a random int and save it into an arraylist and sum up the contents of the array list. then ask the user if they would like to roll again. any point in the right direction would be appreciated. so far … |
|
so i need some help, have random int that decide which values in my Boolean array are true. All th [CODE] System.out.println ("pick a number 1-9"); int guess; for ( int i = 0; i < 9; ++i ){ guess = console.nextInt(); if (x[i] = true) { System.out.println("CORRECT!!"); }else if … |
|
I'm wondering how to start a Boolean array at 1 instead of 0. so far the only thing i can think of is: [CODE] Boolean [] x = new Boolean[12]+ 1; or Boolean [] x= new Boolean[12 + 1]; [/CODE] and the top one does not compile while the bottom … |
|
here are the instructions for my assignment Write a program that counts the number of words, lines and total characters (not including whitespace) in a paper, assuming that consecutive words are separated either by white space or end-of-line characters. Your output from this particular file should say: line count: 58 … |