KING TeC Java : The Basics Avery Swank and Matthew Zwinger How To - - PowerPoint PPT Presentation

king tec
SMART_READER_LITE
LIVE PREVIEW

KING TeC Java : The Basics Avery Swank and Matthew Zwinger How To - - PowerPoint PPT Presentation

KING TeC Java : The Basics Avery Swank and Matthew Zwinger How To Brew Fresh Java For Tired Team Members Pour the water in the reservoir and put the carafe on the heating plate. Measure Your Grounds: Add the desired amount of grounds to the


slide-1
SLIDE 1

KING TeC

Avery Swank and Matthew Zwinger

Java : The Basics

slide-2
SLIDE 2

How To Brew Fresh Java For Tired Team Members

Pour the water in the reservoir and put the carafe on the heating plate. Measure Your Grounds: Add the desired amount of grounds to the filter: about 1 tablespoon per 5 to 6 fluid

  • unces of cold water for regular coffee, and 2

tablespoons per 5 to 6 fluid ounces for strong coffee.

slide-3
SLIDE 3

Agenda

  • Programming team goals
  • Java programming overview
  • Data types
  • Variables
  • Statements
  • Loops
  • Classes
slide-4
SLIDE 4

Goals of the programming department

  • Improve efficiency
  • Always be thinking of ideas
  • Teamwork
slide-5
SLIDE 5

Planning coding

  • Identify objectives
  • Break projects into smaller pieces
  • Variables and Structures
  • Time management
slide-6
SLIDE 6

Good Programming Habits

  • Use proper syntax
  • Keep similar programming styles
  • Make things easier to manage
  • Don’t trip on wires
  • Stick to your deadlines
slide-7
SLIDE 7

What is Java?

Java is an object orientated programming language that was designed for the distributed environment of the internet.

slide-8
SLIDE 8

Java Programming Platforms

  • Eclipse

○ Used for day to day coding. ○ Very versatile. ○ Industry standard.

  • Android Studio

○ Used for the programming of apps. ○ Used by Prior Lake Robotics FTC teams.

  • Netbeans

○ For developing desktop, mobile, and web applications. ○ Uses Java, Javascript, HTML5, PHP, C/C++, and more.

slide-9
SLIDE 9

Classes

A class is a collection of related properties and behaviors, A class contains fields and methods (We will talk about these later) to describe the behavior of an object

slide-10
SLIDE 10

Basic Layout - Hello World

Prints “Hello World” to the console. ← Class ← Main Method

slide-11
SLIDE 11

Comments

← Single Line ← Multi-line

slide-12
SLIDE 12

Variables

declaring initializing

slide-13
SLIDE 13

Primitive data types

int - an integer or whole number 12 , 2169 , 1234 double - a decimal 2.22 , .25 , 1.1 boolean true or false char or character - holds a single letter or integers ‘A’ , ‘b’ , 2 , 45

Primitive data is data type provided by your program as simple building blocks.

slide-14
SLIDE 14

Non-Primitive data types

Non-primitive data types are not defined by the programming language

slide-15
SLIDE 15

Concatenation

To attach strings and variables together with the plus symbol

slide-16
SLIDE 16

Boolean Expressions

ints , doubles , booleans , and chars Strings Boolean expression is a statement that compares all data typed and returns a true

  • r false.
  • Ex. if(3 > 2) it will return true
slide-17
SLIDE 17

If and If-else statements

← boolean expression

slide-18
SLIDE 18

If and If-else statements

Output to Console

slide-19
SLIDE 19

Else-if ladder

Output to Console

slide-20
SLIDE 20

Switch-cases

Output to Console

slide-21
SLIDE 21

Loops

All loops in java require three things…

  • An initialized value
  • An increment
  • And a stopping value
slide-22
SLIDE 22

Increments and Decrements

Increase by 1 Decrease by 1

slide-23
SLIDE 23

Loops - for

Output to Console

slide-24
SLIDE 24

Loops - do

Output to Console

slide-25
SLIDE 25

Loops - While

Output to Console

slide-26
SLIDE 26

Scanner Class

← Import

Declares the class ‘Scanner’

← Strings

← imports!

slide-27
SLIDE 27

Scanner Class

Output to Console

slide-28
SLIDE 28

Math Class

|a| a^b a^(1/2)

slide-29
SLIDE 29

Math Class

slide-30
SLIDE 30

Methods

← Method 1 3

slide-31
SLIDE 31

Methods

slide-32
SLIDE 32

Questions?

slide-33
SLIDE 33

Thanks For Attending! All presentations will be available soon on www.kingtec2169.com