Reminder: Unit 1 Test – Monday

Slides:



Advertisements
Similar presentations
Continuation of chapter 6…. Nested while loop A while loop used within another while loop is called nested while loop. Q. An illustration to generate.
Advertisements

Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 3: Flow Control I: For Loops.
CROSSWORD. 1. The oldest variety of cycling. 2. Sport in which players try to hit other players with balls and avoid being hit. 3. What is the material.
For(int i = 1; i
Introduction to Computer Science Robert Sedgewick and Kevin Wayne Recursive Factorial Demo pubic class Factorial {
Loops –Do while Do While Reading for this Lecture, L&L, 5.7.
Picture It Very Basic Game Picture Pepper. Original Game import java.util.Scanner; public class Game { public static void main() { Scanner scan=new Scanner(System.in);
Types of Sports Ball games Basketball Football Racket games Tennis
1 Calling within Static method /* We can call a non static method from a static method but by only through an object of that class. */ class Test1{ public.
Craps. /* * file : Craps.java * file : Craps.java * author: george j. grevera, ph.d. * author: george j. grevera, ph.d. * desc. : program to simulate.
Computer Programming Lab 8.
12 Pontoon1May Pontoon program CE : Fundamental Programming Techniques.
Acevedo Team Sports Unit 3
10-Jun-15 Fibonacci Numbers A simple example of program design.
Fibonacci Numbers A simple example of program design.
University of British Columbia CPSC 111, Intro to Computation 2009W2: Jan-Apr 2010 Tamara Munzner 1 Loops III Lecture 20, Fri Mar
Random (1) Random class contains a method to generate random numbers of integer and double type Note: before using Random class, you should add following.
10 ThinkOfANumber program1July ThinkOfANumber program CE : Fundamental Programming Techniques.
QUIZ Solve the questions and find out the answers by putting letters in the correct order.
Question 1 Merdeka Cup is associated with  Badminton  Volley Ball  Hockey  Football Football.
How-to Play Tennis FOR BEGINNERS. Rackets Light weight Wide head Long length Any brand Synthetic Materials.
TENNIS UNIT LIFETIME SPORTS.
Virtual Moneyball: A Baseball League Simulator By Ryan Kroening.
AP STATISTICS LESSON SIMULATING EXPERIMENTS.
Simulating with a Random Digit Table or Calculator AP Statistics Spring 2012.
Table Tennis The change of rules The tactics in table tennis Development process Event terms Equipment.
Sport in our life Thursday, the fourteenth of November Class work.
CSE 114 Computer Science I Objects Lake Superior, Michigan.
Sport plays a very important role in our life. Many people go in for sports because it helps to be healthy.
Indentation & Readability. What does this program do? public class Hello { public static void main ( String[] args ) { //display initial message System.out.println(
Holt McDougal Algebra 2 Surveys, Experiments, and Observational studies How do I focus on the commonalities and differences between surveys, experiments,
More loops while and do-while. Recall the for loop in general for (initialization; boolean_expression; update) { }
The Math class Java provides certain math functions for us. The Math class contains methods and constants that can be very useful. The Math class is like.
FOR LOOP WALK THROUGH public class NestedFor { public static void main(String [] args) { for (int i = 1; i
Building java programs, chapter 3 Parameters, Methods and Objects.
A ball should go either to the left or right after hitting the pin, depending on the random number used. 01 Four random numbers in a sequence are needed.
Math Class Mrs. C. Furman September 2, Math frequently used methods NameUse floor()rounds down ceil()rounds up pow(x,y)returns x to the power of.
Creating and Using Class Methods. Definition Class Object.
S ECTION 5.3 – S IMULATIONS. W HAT IS A SIMULATION ? A simulation is a mock trial of an experiment without doing the experiment. It uses theoretical probabilities.
MATLAB Lab Simulating Billiard Game Modify hitball.m and myball.m to simulate 3-cushion billiard game. Rules: –two players –three balls.
At lunch time we all went out side to play Dodgeball. In Dodgeball there are two teams. There are three Rules in Dodgeball: 1. If you get hit by the ball.
Statistics 1.5 Design of an Experiment Objective: to identify and design an experiment.
Lesson 7 Iteration Structures. Iteration is the third control structure we will explore. Iteration simply means to do something repeatedly. All iteration.
Basic Class Structure. Class vs. Object class - a template for building an object –defines the instance data that the object will hold –defines instance.
The Rules of Tennis. Rule #1 Opponents stand on opposite side of the court. The server is the person who delivers the ball. The other person who stands.
Three kinds of looping structures The while loop The for loop The do (also called the do-while) loop All have equivalent power, e.g., if you can write.
Sport in the UK. Sport The British love sport very much. There are a lot of kinds of sport invented in GB.
By Victoria Israël and Daphnée Labrecque
AKA the birth, life, and death of variables.
התוכנית: using System; using System.Collections.Generic;
using System; namespace Demo01 { class Program
Team custom space pong By: Dorean and Frankie.
4. 2 Solving Inequalities Using Addition or Subtraction 4
By: Miss Kelsey.
Sports and Leisure Activities
A simple example of program design
By: Josh Liberati, Jannik Schmidt, Cody Freeland
Sports Baseball 5th grade.
Physics-based simulation for visual computing applications
Tennis playbook Your subtitle goes here.
Hello, my name is Mathieu.
AKA the birth, life, and death of variables.
References and Objects
class PrintOnetoTen { public static void main(String args[]) {
CIS 110: Introduction to Computer Programming
Perfect squares class identifySquareButLessClever {
Agenda Warmup Lesson 1.9 (random #s, Boolean variables, etc)
The only way to prove that you’re good at a sport is to lose
Lecture 9 Using Objects.
Agenda Warmup Lesson 1.9 (random #s, Boolean variables, etc)
Presentation transcript:

Reminder: Unit 1 Test – Monday

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? }

More warmup int z = 0; for ( ; z<5; z+=2) { System.out.print(z); break; } // result?

More warmup 5) int z = 0; for (z=1; z<5; z+=2) { System.out.print(z); break; } // result?

More warmup 6) int z = 0; for (z=1; z<5; z+=2) { System.out.print(z); } z+=3; // result?

More warmup 7) int z = 2; for (z=1; z<=5; z+=2) { System.out.print(z); } z++; z*=2; z--; // result?

More warmup 8) int z = 2; for (; z<=5; z+=2) { System.out.print(z); z++; } z/=1; z*=1; z+=1; // result?

(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