Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Programming using Java

Similar presentations


Presentation on theme: "Introduction to Programming using Java"— Presentation transcript:

1 Introduction to Programming using Java
Day 7 and 8 Review Robocode Robots!

2 Review Classes and Objects What 2 things an object has data methods
public and private methods have return types one object may inherit from another

3 Instantiating an Object
2 ways String bob = “this is a string”; String bob = new String(“this is a string”); Pig wilbur; Pig wilbur = new Pig();

4 New Concepts packages imports

5 Robocode let's take a look at some java code

6 The Java API

7 Robocode API

8 Task 7 Start the Robocode IDE Create your own Robocode Robot
set the color of its bullets set the color of its body start a battle

9 Day 8 Review import package Robocode and API:

10 Robocode API

11 New Concepts Jar files Algorithms
an algorithm is a step-by-step procedure for doing something

12 The “Getting Ready for School” Algorithm
1. wake up 2. get dressed 3. eat breakfast 4. brush teeth 5. assemble school items like lunch, homework, etc 6. leave for school

13 “Drive in a square” algorithm
1. drive 100 units 2. turn right 90 degrees 3. drive 100 units 4. turn right 90 degrees 5. drive 100 units 6. turn right 90 degrees 7. drive 100 units

14 Task 8 Part 1: make your robocode robot drive in a square
Part 2: make up your own algorithm to have your robocode robot “do nothing” until it is hit 5 times by a bullet Part 3: write the program for Part 2!


Download ppt "Introduction to Programming using Java"

Similar presentations


Ads by Google