Download presentation
Presentation is loading. Please wait.
1
Reminder: Unit 1 Test – Monday
2
Warmup x = (int)(Math.random()*5+15);
// this creates a random # between __ and __? 2) for (int x; x<word.charAt(3); x=x++;) // find the bugs public static void main (String[] args) { int x = 0; if (x<5) break; } // result? }
3
More warmup int z = 0; for ( ; z<5; z+=2) { System.out.print(z);
break; } // result?
4
More warmup 5) int z = 0; for (z=1; z<5; z+=2) { System.out.print(z); break; } // result?
5
More warmup 6) int z = 0; for (z=1; z<5; z+=2) { System.out.print(z); } z+=3; // result?
6
More warmup 7) int z = 2; for (z=1; z<=5; z+=2) { System.out.print(z); } z++; z*=2; z--; // result?
7
More warmup 8) int z = 2; for (; z<=5; z+=2) { System.out.print(z); z++; } z/=1; z*=1; z+=1; // result?
8
(GameRandom) Write a program that simulates a game from any sport (other than Australian Rules Badminton). Use random numbers to determine events – whether a baseball player gets a hit, whether a tennis ball goes out of bounds, how far a golf ball travels, etc. You decide: player1-vs-player2, or player-vs-computer. You should determine how/where to use loops to continue the game, allow multiple games, etc Work on incomplete assignments
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.