Awesome, Thank you!!
Type: Posts; User: Heri623
Awesome, Thank you!!
was working fine but when I tried to use try and catch, it now says my variables are not initialized.
/***********************
* BMI.java
* Eddy Caraballo
*
all 0s. is there a problem with this line?
numberAsterisk = (int) ((tally[i] / numberRolls) * 100);
Shouldn't that take the element at position i in the array, divide by number of rolls,...
Got that part working, thanks. Now I'm trying to print percentages, but I can't get it to go through the second for loop. j starts at 0, and numberAsterisk is a percentage, so shouldn't it print...
cry?
i set the array to 11
but then i get this error
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 11
what's possible is 2-12 impossible would 1, and anything >12
11 elements stored in the array 2-12
first would be 0 and last would be 11
my assignment is to code a program to simulate the rolling of 2 dice. I have most of it set but when I run it and have it print out how many times each number (2-12) was rolled, it displays the...
Thanks for all the help.
Finally got it figured out.
Sorry for being so dense.
I understand the what you're saying but I am hitting a wall as to what I need to do .
Do I need to Parse the integer back to a string?
----jGRASP exec: javac -g RockPaperScissors.java
RockPaperScissors.java:24: error: int cannot be dereferenced
if (pChoice.equals("Rock") || pChoice.equals("Paper") ||...
As usual i've waited until the last minute to work on this and now i'm stuck.
I'm not sure what is causing the error.
Any help would be greatly appreciated.
PS i'm not very Java savvy so maybe...
I've tweaked this a little and it doesn't loop anymore but I lost the ability to quit when 'q' is entered.
/******************
*Pig Latin Program
Eddy Caraballo
I'm new to programming (this is my 3rd program ever)
We have an assignment to create a Pig Latin translator, but when i run it it repeats the answer over and over again. Not sure what I am doing...