I am trying to write a method rollDice(int number, int nSides) which returns the total result of rolling the number dice with nSides sides.
So for example rollDice(3
How about this as your rollDice method:
public static int rollDice(int number, int nSides) { int count = 0; for(int i = 0; i < number; i++) { count += (int)(Math.random() * nSides) + 1; } return count; }