User Profile
Collapse
-
For Ex if roll2Dice( ) feeds back a 3, I want to add 1 this to the "appropriat e element of the array with out using an if statement."
If you want to look at the code i have so far
...Code:public class Dice { public static void main(String[] args) { int[] count = new int[13]; int roll = 1; while (roll <= 3600) { int i = roll2Dice();Leave a comment:
-
How Can I??
How Can i do this with out using an if statement?
Hint please
Code:while (roll <= 3600) { int i = roll2Dice(); if (i == 3) count[3] = count[3] + 1; if (i == 5) count[5] = count[5] + 1; if (i == 7) count[7] = count[7] + 1; if (i == 9) count[9] = count[9] + 1; if (i == 11) count[11] = count[11] + 1; roll = roll + 1; } -
Help please
I was writing a simple programs on arrays and i dont know why these error pop up if some can explain what im doing wrong
public class CoinValues {
public static void main(String[] args) {
int[] coinValue = {5,10,25};
String[] coinWord = {"nickels","dim es","quarters"} ;
int count = IB.inputInt("Ho w many coins do you have? ");
int i = IB.inputInt("En ter...
No activity results to display
Show More
Leave a comment: