Programming What is a program? –A set of instructions –Understood by a computer.

Slides:



Advertisements
Similar presentations
Chapter 2 First Java Programs
Advertisements

AA high level programming language. IIt is created by Microsoft. UUses a graphical environment called the Integrated Development Environment (IDE).
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
MC697 Object-Oriented Programming Using Java. In this class, we will cover: How the class will be structured Difference between object-oriented programming.
Creating a Program In today’s lesson we will look at: what programming is different types of programs how we create a program installing an IDE to get.
Slides prepared by Rose Williams, Binghamton University Chapter 1 Getting Started 1.1 Introduction to Java.
1 Applets Chapter 1 To understand:  why applets are used to extend the capabilities of Web pages  how an applet is executed and know about the restrictions.
ObjectDraw and Objects Early Chris Nevison Barbara Wells.
A Sample Program A rudimentary solar simulation: We want a click of the mouse in the window to make the ‘sun’ rise.
Programming Introduction November 9 Unit 7. What is Programming? Besides being a huge industry? Programming is the process used to write computer programs.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
1 CHAPTER 4 LANGUAGE/SOFTWARE Hardware Hardware is the machine itself and its various individual equipment. It includes all mechanical, electronic.
PHY281Introduction to JavaSlide 1 Introduction to Java In this section we will learn how how to use Java and write our first Java Applet:  The Java Development.
Marlene Galea.  The JDK (Java Development Kit)  An IDE (Integrated Development Environment) ◦ Different IDEs include:  JCreator  NetBeans  BlueJ.
Editing Java programs with the BlueJ IDE. Working environments to develop (= write) programs There are 2 ways to develop (write) computer programs: 1.Using.
Unit Six Assignment 1 Chris Boardley.
C++ Crash Course Class 1 What is programming?. What’s this course about? Goal: Be able to design, write and run simple programs in C++ on a UNIX machine.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Java Programs COMP 102 #3.
Introduction 01_intro.ppt
Introduction to Java Tonga Institute of Higher Education.
Introducing Java.
Visual Basic Chapter 1 Mr. Wangler.
Introduction to Programming Lecture Number:. What is Programming Programming is to instruct the computer on what it has to do in a language that the computer.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 16: Java Applets & AWT Fundamentals of Web Programming.
Testing. What is Testing? Definition: exercising a program under controlled conditions and verifying the results Purpose is to detect program defects.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
David Streader Computer Science Victoria University of Wellington Copyright: David Streader, Victoria University of Wellington GUI and the UI API COMP.
Higher Grade Computing Studies 2. Languages and Environments Higher Computing Software Development S. McCrossan 1 Classification of Languages 1. Procedural.
111 © 2002, Cisco Systems, Inc. All rights reserved.
David Streader Computer Science Victoria University of Wellington Copyright: David Streader, Victoria University of Wellington While loops and the UI API.
Overview of our Approach Program Structure –Data, variables, and parameters –Basic control structures (conditionals, loops and Threads) –Class definitions.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Chapter 1: A First Program Using C#. Programming Computer program – A set of instructions that tells a computer what to do – Also called software Software.
Intro to Java & Processing. Review CS is about problem-solving CS is about problem-solving To write programs you must To write programs you must –Be able.
1 Chapter 2 First Java Programs Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Chapter 1 CSIS-120: Java Intro. What is Programming?  A: It is what makes computer so useful.  The flexibility of a computer is amazing  Write a term.
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
Lesson 2: First Java Programs. Objectives: –Discuss why Java is an important programming language. –Explain the Java virtual machine and byte code. –Choose.
Just as there are many human languages, there are many computer programming languages that can be used to develop software. Some are named after people,
C H A P T E R T E N Event-Driven Programming Programming Languages – Principles and Paradigms by Allen Tucker, Robert Noonan.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
I Power Higher Computing Software Development Development Languages and Environments.
Chapter 2 Objects and Mutator Methods. A Sample Program A rudimentary solar simulation: We want a click of the mouse in the window to make the ‘sun’ rise.
Graphics Concepts CS 2302, Fall /17/20142 Drawing in Android.
C++ LANGUAGE TUTORIAL LESSON 1 –WRITING YOUR FIRST PROGRAM.
Graphics Tools and Parameters Chris Nevison Barbara Wells.
Compiling and running Java programs with BlueJ. Successfully compiled files program files in BlueJ You can tell from the shade of a program icon in BlueJ.
Java FilesOops - Mistake Java lingoSyntax
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Java Programs COMP 102 #3.
Object Oriented Programming Criteria: P2 Date: 07/10/15 Name: Thomas Jazwinski.
Objective You will be able to define the basic concepts of object-oriented programming with emphasis on objects and classes by taking notes, seeing examples,
The Development Process Compilation. Compilation - Dr. Craig A. Struble 2 Programming Process Problem Solving Phase We will spend significant time on.
1.1: Objects and Classes msklug.weebly.com. Agenda: Attendance Let’s get started What is Java? Work Time.
Principles of Programming CSEB134 : BS/ CHAPTER Fundamentals of the C Programming Language.
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
Java Objects (Java: An Eventful Approach, Ch 2), Slides Credit: Bruce, Danyluk and Murtagh CSCI 120 Lecture October 2012.
Teaching Control Structures, using objectdraw Chris Nevison Barbara Wells.
© 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.
1 Introduction to Haptics Introduction to the Hapkit board Allison M. Okamura Stanford University.
BlueJ X ICSE Syllabus. Board Pattern THEORY (100 marks) PRACTICAL (100 marks) PROJECT (50 marks) ASSIGNMENTS (50 marks)
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
Software Development Environment
INTRODUCTION TO ROBOTICS Part 5: Programming
Introduction to Computer CC111
Introduction to Computers and Java
Java Programming: Guided Learning with Early Objects
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Presentation transcript:

Programming What is a program? –A set of instructions –Understood by a computer

What does a program look like? An algorithm is a set of instructions designed to accomplish a specific goal For a temperature f in Fahrenheit Subtract 32 from f. Divide f by 1.8. Display the value of f. [Converts to Celsius] Don’t need to understand the goal to follow instructions

Programming Languages A language is a tool with which we tell a computer an algorithm Compilers translate from one computer language to another Each language has own advantages and disadvantages

The Java Language Widely Used Can be compiled on many computer systems Object Oriented (we’ll learn what this means later)

Event Driven Programming Old programs would start with all input at once and run until completion Event: An action, a mouse click, an item selected Using events made easy in Java

A First Program import objectdraw.*; import java.awt.*; public class TouchyWindow extends WindowController { public void onMousePress ( Location point ) { new Text("I’m touched", 40, 50, canvas ); } public void onMouseRelease( Location point ) { canvas.clear(); }

What do all these words mean? Let’s break the program apart

Some of the words Class –A set, collection, group, or configuration containing members regarded as having certain attributes or traits in common. (American Heritage Dictionary) –Very similar meaning in Java

Software Libraries Reuse code already written extends –Builds upon an already written class import –Allows the use of instructions written elsewhere

Parts of a Class Body –Enclosed in the curly braces found on the line “public class…” Methods: public void onMousePress ( Location point ) { new Text( "I’m touched", 40, 50, canvas ); }

The Life of a Program Write the Program Translate the program into a language the computer understands Run the Program

Integrated Development Environments Eclipse –Professional Programming Tool TouchyWindow in Eclipse

Integrated Development Environments BlueJ –Designed to teach Java TouchyWindow in BlueJ

Integrated Development Environments Eclipse and BlueJ: –Available on Windows, MacOS, Unix –Free and downloadable

More Programming Normal vs Graphics Coordinate Systems

Graphical Objects new Text ( "I’m Touched", 40, 50, canvas ); new an instruction that tells we want to construct a new object Text the object we want to construct (…) comma delineated “parameters” that tell how to construct the object ; semicolons are important too! –every command semicolon terminated

Graphical Objects new Text ( "I’m Touched", 40, 50, canvas );

Events public void onMousePress( Location point ) –Will run the code when mouse button is pressed onMouseRelease: –Runs code when the buttons released Many more mouse event handling methods

The begin Method public void begin(){ … } begin method –Executed (run) exactly once for each program –Executed early in program’s life

Graphical Objects new Line( 100, 150, 200, 0 canvas);

Graphical Objects New FilledRect( 10, 20, 30, 40, canvas ); –Creates a 30x40 rectangle –Upper left corner at (10,20) new FilledOval( 10, 20, 30, 40, canvas); –Imagine a 30x40 rectangle at (10,20) –Draws the largest oval that can fit inside the imaginary rectangle

Mistakes? Impossible! Sadly, computers read what is written, not the intention. Errors will often generate complaints from the IDE. Some complaints are more informative than others