Im just starting Java course and professor have asked us to fill out the window with small circles making it look like stars. We need to use Math.random()*MAX to set the random amount and size with a given limit.
I have been trying different things but I feel so lost with Java. I have also look for examples online but they are all about random numbers.
gc.fillRect(0, 0, 400, 400);
gc.setFill(Color.WHITE);
gc.fillOval(50, 60, 2, 2);
gc.fillOval(150, 200, 2, 2);
gc.fillOval(150, 100, 3, 3);
gc.fillOval(230, 220, 3, 3);
gc.fillOval(80, 200, 2, 2);
gc.fillOval(350, 200, 2, 2);
gc.fillOval(300, 250, 2, 2);
gc.fillOval(320, 350, 2, 2);
gc.fillOval(20, 320, 2, 2);
Instead of having all this lines repeat with different values I believe the Math.random is supposed to do it but im not sure how to use it properly, or how to implement it properly to my problem. Any example or guidance is more than welcome.