BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
IT 325 OPERATING SYSTEM C programming language. Why use C instead of Java Intermediate-level language:  Low-level features like bit operations  High-level.
5/17/ Programming Constructs... There are several types of programming constructs in JAVA. - If-else construct or ternary operator - while - do-while.
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
CS 225 Java Review. Java Applications A java application consists of one or more classes –Each class is in a separate file –Use the main class to start.
Fundamental Programming Structures in Java: Comments, Data Types, Variables, Assignments, Operators.
Hello, world! Dissect HelloWorld.java Compile it Run it.
CMSC 341 Introduction to Java Based on tutorial by Rebecca Hasti at
Comp 248 Introduction to Programming Chapter 4 - Defining Classes Part A Dr. Aiman Hanna Department of Computer Science & Software Engineering Concordia.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
DAT602 Database Application Development Lecture 5 JAVA Review.
By Nicholas Policelli An Introduction to Java. Basic Program Structure public class ClassName { public static void main(String[] args) { program statements.
Session One Introduction. Personal Introduction Role of programmers Robot Examination HUD & HID Uploading Code.
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
CSC Java Programming, Fall, 2008 Week 2: Java Data Types, Control Constructs, and their C++ counterparts, September 4.
Lecture 2 Object Oriented Programming Basics of Java Language MBY.
Control Structures if else do while continue break switch case return for.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
CS591x A very brief introduction to Java. Java Developed by Sun Microsystems was intended a language for embedded applications became a general purpose.
Basics of Java IMPORTANT: Read Chap 1-6 of How to think like a… Lecture 3.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
Netprog: Java Intro1 Crash Course in Java. Netprog: Java Intro2 Why Java? Network Programming in Java is very different than in C/C++ –much more language.
 JAVA Compilation and Interpretation  JAVA Platform Independence  Building First JAVA Program  Escapes Sequences  Display text with printf  Data.
Using Data Within a Program Chapter 2.  Classes  Methods  Statements  Modifiers  Identifiers.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 2: Variables & Data Types.
An Introduction to Java – Part 1 Dylan Boltz. What is Java?  An object-oriented programming language  Developed and released by Sun in 1995  Designed.
 The if statement and the switch statement are types of conditional/decision controls that allow your program.  Java also provides three different looping.
Primitive data Week 3. Lecture outcomes Primitive data – integer – double – string – char – Float – Long – boolean Declaration Initialisation Assignments.
Introduction to Java Java Translation Program Structure
Fall 2015CISC124 - Prof. McLeod1 CISC124 Have you filled out the lab section survey? (As of last night 54 left to fill out the survey.) TA names have been.
Final Jeopardy Fundamen tal Java Numerical Data type Boolean Expressi on If/THEN/ WHILE Miscellan eous
Chapter 2 Input, Variables and Data Types. JAVA Input JAVA input is not straightforward and is different depending on the JAVA environment that you are.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
Java Nuts and Bolts Variables and Data Types Operators Expressions Control Flow Statements Arrays and Strings.
CSM-Java Programming-I Spring,2005 Fundamental Data Types Lesson - 2.
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Programming With Java ICS201 University Of Ha’il1 Chapter 11 Recursion.
Chapter 1 Java Programming Review. Introduction Java is platform-independent, meaning that you can write a program once and run it anywhere. Java programs.
Methods.
A data type in a programming language is a set of data with values having predefined characteristics.data The language usually specifies:  the range.
CPSC 233 Tutorial 5 February 9 th /10 th, Java Classes Each Java class contains a set of instance variables and methods Instance Variables: Type.
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Features of JAVA PLATFORM INDEPENDENT LANGUAGE JAVA RUNTIME ENVIRONMENT (JRE) JAVA VIRTUAL MACHINE (JVM) JAVA APP BYTE CODE JAVA RUNTIME ENVIRONMENT.
Terms: Software  Set of instructions  aka programs  Operating System:  Special software whose job it is to translateinstructions into hardware instructions.
Intro to Programming STARS College of Communication and Information Florida State University Written by: Hannah Brock Alissa Ovalle Nicolaus Lopez Martin.
Eastside Robotics Alliance / Newport Robotics Group 1 T/Th, 6:30 – 8:30 PM Big Picture School Day 3 · 10/9/2014.
Topics introduced today (these topics would be covered in more detail in later classes) – Primitive Data types Variables Methods “for” loop “if-else” statement.
Information and Computer Sciences University of Hawaii, Manoa
Objects as a programming concept
CIS3931 – Intro to JAVA Lecture Note Set 2 17-May-05.
JAVA MULTIPLE CHOICE QUESTION.
Intro to ETEC Java.
Yanal Alahmad Java Workshop Yanal Alahmad
Programming Language Concepts (CIS 635)
An Introduction to Java – Part I
Methods and Parameters
Subroutines Idea: useful code can be saved and re-used, with different data values Example: Our function to find the largest element of an array might.
An Introduction to Java – Part I, language basics
Recap Week 2 and 3.
Programs and Classes A program is made up from classes
Fundamental OOP Programming Structures in Java: Comments, Data Types, Variables, Assignments, Operators.
In this class, we will cover:
Peer Instruction 4 Control Loops.
Names of variables, functions, classes
Methods/Functions.
Introduction to java Part I By Shenglan Zhang.
Presentation transcript:

BEGINNING PROGRAMMING

 Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such as Java) to solve a problem  Ex: Controlling a robot autonomously, mathematical computations, vision processing

 Cross-platform write-once run anywhere high level object-oriented programming language  The Java Virtual Machine  Software that runs on most operating systems  Runs your java code  Handles all OS specific programming problems  Write a program one time and run it on every major OS

Java is based on Objects An Object is an instance of any class, e.g. a String variable Objects provide different functionalities depending on what it’s class was designed to do Makes programming easier because Objects do most of the work

public static void main(String[] args){…} Primitive types (variables) o boolean (true or false) o byte (0-255) o char (a single letter/character) o short (small integer) o int (an integer) o float (decimal number) o double (decimal with double precision of float) o long (very large integer)

An object is an instance of any class (e.g. an instance of the String class) String o Not a primitive type PrintStream (e.g. System.out) o Allows you to output data

The most basic program in any language – just prints out “Hello World” In Java

“Modifies” your program at runtime Changes what/when the program does something based on a test Ex: If a is greater than b, the program does one thing, and does another if a is not greater than Else – the code inside the else block executes if none of the if statements are true

Used when you want to do something multiple times or while a condition is true For loop While loop Do-while loop

Public void name(){…} Most basic definition: a block of code that does something useful Use methods to simplify code and make programming easier o Ex: arm.setAngle(90) is much easier than directly controlling the motors and stopping it at 90 degrees

Argument – any data that you pass to a method Ex: o Where a and b are the numbers that you want to add Arguments give data to a method so that it can do what it was designed to do

Public/Private – controls who can access this method o Private - only accessible within the defining class o Public - accessible by any class or object Static – no instance of object required to run the method

Void – doesn’t return anything o Ex: Object – returns an Object of the specified class o Ex: Return data using the return command o Ex: