- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
3 Posted Topics
[CODE]//Find the sum and average for (int i = 0; i < numbers.length; i++){ sum += numbers[i]; int average = sum / TOTAL_NUMBERS; }[/CODE] Here you are making the average an integer, when in reality it should be a float so that you have the correct precision. you can either: …
[QUOTE][CODE]//Find the sum and average for (int i = 0; i < numbers.length; i++){ sum += numbers[i]; int average = sum / TOTAL_NUMBERS; }[/CODE][/QUOTE] Here you are making the average an integer, when in reality it should be a float so that you have the correct precision. you can either: …
I am assuming that you are trying to simply check if your "monster" is alive and if it is, say so in the console? If so, in your main method you simply need: [CODE]if( winston.getEnergy()) { System.out.println("This thing is alive"); }[/CODE] As for your constructor question. A constructor is used …
The End.
Foxh451