Basics Programming Concepts. Basics A computer program is a set of instructions to tell a computer what to do Machine language = circuit level language.

Slides:



Advertisements
Similar presentations
Designing a Program & the Java Programming Language
Advertisements

compilers and interpreters
Write a program step by step. Step 1: Problem definition. Given the coordinate of two points in 2-D space, compute and print their straight distance.
IT253: Computer Organization Lecture 6: Assembly Language and MIPS: Programming Tonga Institute of Higher Education.
INTRODUCTION Chapter 1 1. Java CPSC 1100 University of Tennessee at Chattanooga 2  Difference between Visual Logic & Java  Lots  Visual Logic Flowcharts.
Begin Java Pepper. Objectives What is a program? Learn the basics of your programming tool: BlueJ Write a first Java program and see it run Make some.
Dale Roberts Introduction to Java - First Program Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and.
JAVA BASICS SYNTAX, ERRORS, AND DEBUGGING. OBJECTIVES FOR THIS UNIT Upon completion of this unit, you should be able to: Explain the Java virtual machine.
Your First Java Program: HelloWorld.java
How do we make our Welcome.java program do something? The java in our Welcome.java file won’t do anything by itself. We need to tell the computer to execute.
How do we make our HelloTester.java program do something? The java in our HelloTester.java file won’t do anything by itself. We need to tell the computer.
Java Intro. A First Java Program //The Hello, World! program in Java public class Hello { public static void main(String[] args) { System.out.println("Hello,
Chapter 16 Programming and Languages: Telling the Computer What to Do.
1. 2 Chapter 1 Introduction to Computers, Programs, and Java.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Chapter 1 - Introduction. Ch 1Goals To understand the activity of programming To learn about the architecture of computers To learn about machine code.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Java Programs COMP 102 #3.
6 Steps of the Programming Process
Introduction to Java Tonga Institute of Higher Education.
Java Programming, 2E Introductory Concepts and Techniques Chapter 2 Creating a Java Application and Applet.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Hello World 2 What does all that mean?.
Chapter 3: Completing the Problem- Solving Process and Getting Started with C++ Introduction to Programming with C++ Fourth Edition.
Introduction to the Java Virtual Machine 井民全. JVM (Java Virtual Machine) the environment in which the java programs execute The specification define an.
Session One Introduction. Personal Introduction Role of programmers Robot Examination HUD & HID Uploading Code.
© 2006 Pearson Education 1 Obj: cont 1.3 and 1.4, to become familiar with identifiers and to understand how programming languages work HW: p.51 #1.8 –
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
Intro and Review Welcome to Java. Introduction Java application programming Use tools from the JDK to compile and run programs. Videos at
Java Programming, Second Edition Chapter One Creating Your First Java Program.
Board Activity Find your seat on the seating chart Login – Remember your login is your first initial your last name and the last three numbers of your.
Programming Concept Chapter I Introduction to Java Programming.
CHAPTER 3 GC Java Fundamentals. 2 BASICS OF JAVA ENVIRONMENT  The environment  The language  Java applications programming Interface API  Various.
Fall 2006Slides adapted from Java Concepts companion slides1 Introduction Advanced Programming ICOM 4015 Lecture 1 Reading: Java Concepts Chapter 1.
J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition Second Edition D.S. Malik D.S. Malik.
JAVA Practical Creating our first program 2. Source code file 3. Class file 4. Understanding the different parts of our program 5. Escape characters.
CS101: Introduction to Computer Science Slides adapted from Sedgewick and Wayne Copyright © Your First Java.
Agenda Computer Languages How to Write a Simple C Program
How to Program? -- Part 1 Part 1: Problem Solving –Analyze a problem –Decide what steps need to be taken to solve it. –Take into consideration any special.
By: Cheryl Mok & Sarah Tan. Java is partially interpreted. 1. Programmer writes a program in textual form 2. Runs the compiler, which converts the textual.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
Creating a Java Application and Applet
Java FilesOops - Mistake Java lingoSyntax
CHAPTER 1 INTRODUCTION. CHAPTER GOALS To understand the activity of programming To learn about the architecture of computers To learn about machine code.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Java Programs COMP 102 #3.
Introduction to C++.  Computers: CPU, Memory & Input / Output (IO)  Program: Sequence of instructions for the computer.  Operating system: Program.
Lecture1 Instructor: Amal Hussain ALshardy. Introduce students to the basics of writing software programs including variables, types, arrays, control.
Compilers and Interpreters
© Peter Andreae Java Programs COMP 102 # T1 Peter Andreae Computer Science Victoria University of Wellington.
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
Chapter 3 Introducing Java. Objectives and Goals 1. Define terminology associated with object- oriented programming. 2. Explain why Java is a widely used.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
Introduction to 1. What is Java ? Sun Microsystems Java is a programming language and computing platform first released by Sun Microsystems in The.
CS 201 Lecture 1 (b) Using an IDE Tarik Booker CS 201: Introduction to Programming California State University, Los Angeles.
Computer Programming Your First Java Program: HelloWorld.java.
Why don’t programmers have to program in machine code?
Dept of Computer Science University of Maryland College Park
Writing, Compiling and Running a C program
Introduction to programming
Object-Oriented Programming Using Java
CSCI-235 Micro-Computer Applications
Introduction to.
TRANSLATORS AND IDEs Key Revision Points.
Assembler, Compiler, Interpreter
Writing Methods.
Programming Vocabulary.
High Level Programming Languages
Hands-on Introduction to JAVA
Java Intro.
Assembler, Compiler, Interpreter
Presentation transcript:

Basics Programming Concepts

Basics A computer program is a set of instructions to tell a computer what to do Machine language = circuit level language for the computer; converts to 0s and 1s High level programming language = “human” language used to write a program – Public; class; if; etc. Syntax – rules of the language – Ex – all programs in a “class”; system.out.printline

Basics - continued Programmers write programs using high level language – must get translated into machine language = compiling Syntax errors – misuse of the language – Compiler error Debugging – fixing syntax errors

Java Just one type of language in existence Write the source code ….. Save as a.java file …. Compile the source code…. If there are no syntax errors it will compile and save as a.class file.java Textpad software Source Code.class Compile Code Run Program

When the program runs, it is the.class file that gets executed.

Basic Java Application public class First { public static void main (String[] args) { System.out.println(“First Java app”); } Every application initially follows this format This will change as you write programs

Comments public class First { public static void main (String[] args) { //this next line displays text System.out.println(“First Java app”); } //Comments needed to describe what your code is supposed to do!!

Indenting Code public class First { //notice how the line is indented public static void main (String[] args) { //this next line displays text System.out.println(“First Java app”); }