Q 1: Questionable. Cannot go into details without ruining the question for everyone.
Q 9: Comment at end of switch statement is not correct.
Q 11: There is a typo in one of the options.
Q 23: Reason given for correct answer is not accurate. Integer ranges from -2^31 to 2^31-1. Again, cannot go into details without ruining question for everyone.
The class can now only be used locally (not on a site). For help on error, create a discussion thread. Show class of code where error is located and indicate what error you are getting and at which line it occurs.
@Soop__, first log in; then, run the scenario and get killed. When high scores show up, there will be buttons along the bottom of the screen to view source codes of various classes. Use escape to return to high score screen.
@mik., I have 2 tutorials on the site -- one for displaying values (whether text or graphically) and one for scrolling. To help find them, they both have olive green thumbnails with black text (with the word 'tutorial').
From source (comments are mine):
-----------------
// importing class
import java.util.Random;
// creating Random object
private static Random randomGenerator = new Random();
// using Random object
public static int getRandomNumber(int limit)
{
return randomGenerator.nextInt(limit);
}
As far as random, I used it here because I wanted to ensure a new random seed value each and every loading (greenfoot probably does it in a somewhat similar manner, but anyway ...).
2022/2/17
Java Online Quiz
2022/2/14
TextImage Support Class
2022/1/25
Zombie Shooter Demo
2021/12/2
Flying Letters Demo
2021/12/2
Flying Letters Demo
2021/11/9
Flying Letters Demo
2021/11/8
Flying Letters Demo
2021/10/7
Hangman
2021/10/7
Hangman