CompSci 6 Programming Design and Analysis January 17, 2006 Prof. Rodger.

Slides:



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

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.
INTRODUCTION Chapter 1 1. Java CPSC 1100 University of Tennessee at Chattanooga 2  Difference between Visual Logic & Java  Lots  Visual Logic Flowcharts.
CSCE 145: Algorithmic Design I Chapter 1 Intro to Computers and Java Muhammad Nazmus Sakib.
1 Java Basics. 2 Compiling A “compiler” is a program that translates from one language to another Typically from easy-to-read to fast-to-run e.g. from.
1 Fall 2008ACS-1903 Chapter 1 Topics Java History Java Programs Why Program? Computer Systems: Hardware and Software Programming Languages What Is a Program.
Introduction to Computer Programming CSC 1401: Introduction to Programming with Java Lecture 2 Wanda M. Kunkle.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
CS 101 Problem Solving and Structured Programming in C Sami Rollins Spring 2003.
Introduction to Java.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Getting Started with Java
Sadegh Aliakbary Sharif University of Technology Fall 2011.
CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring
CSC 142 A 1 CSC 142 Introduction to Java [Reading: chapter 0]
Chapter 1 Coding Introduction.
Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
CompSci 100e Program Design and Analysis II January 18, 2011 Prof. Rodger CompSci 100e, Spring20111.
111 © 2002, Cisco Systems, Inc. All rights reserved.
1 Chapter 2 First Java Programs Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Introduction to Programming Peggy Batchelor.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Chapter 1 Introduction. Goal to learn about computers and programming to compile and run your first Java program to recognize compile-time and run-time.
Session One Introduction. Personal Introduction Role of programmers Robot Examination HUD & HID Uploading Code.
Sadegh Aliakbary Sharif University of Technology Fall 2012.
Computer Programming A program is a set of instructions a computer follows in order to perform a task. solve a problem Collectively, these instructions.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
JAVA BASICS: Variables and References SYNTAX, ERRORS, AND DEBUGGING.
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
Java Programming, Second Edition Chapter One Creating Your First Java Program.
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
David Streader Computer Science Victoria University of Wellington Copyright: David Streader, Victoria University of Wellington Java Programing Basics COMP.
COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.
Computer Science 101 Introduction to Programming.
CHAPTER 3 GC Java Fundamentals. 2 BASICS OF JAVA ENVIRONMENT  The environment  The language  Java applications programming Interface API  Various.
1 Problem Solving with C++ The Object of Programming Walter Savitch Chapter 1 Introduction to Computers and C++ Programming Slides by David B. Teague,
Chapter 1 Section 1.1 Introduction to Java Slides prepared by Rose Williams, Binghamton University Kenrick Mock, University of Alaska Anchorage.
Jens Dalsgaard Nielsen Jan Dimon Bendtsen Dept. of Electronic Systems Basic Programming INS-basis GF, PDP and HST.
Compsci 6/101, Spring More on Python, Tools, Compsci 101 l APTs, Assignments, Tools  APT: Algorithmic Problem-solving and Testing  How to get.
CT1513 Introduction To java © A.AlOsaimi.
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.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and web applications Very rich GUI libraries Portability (machine independence) A real Object.
Overview Object oriented programming How to run a simple program.
Developed at Sun Microsystems in 1991 James Gosling, initially named “OAK” Formally announced java in 1995 Object oriented and cant write procedural.
Introduction Mehdi Einali Advanced Programming in Java 1.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
Today… “Hello World” ritual. Brief History of Java & How Java Works. Introduction to Java class structure. But first, next slide shows Java is No. 1 programming.
Java FilesOops - Mistake Java lingoSyntax
©2016 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. CSC 110 – INTRO TO COMPUTING - PROGRAMMING Overview of Programming.
Getting Started With Java September 22, Java Bytecode  Bytecode : is a highly optimized set of instructions designed to be executed by the Java.
CompSci 101 Introduction to Computer Science January 28, 2016 Prof. Rodger compsci101 spring161.
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.
Software Engineering Algorithms, Compilers, & Lifecycle.
Chapter 1 Coding Introduction.
Basic Concepts: computer, program, programming …
Lecture 1b- Introduction
GC101 Introduction to computer and program
Lecture 1: Introduction to JAVA
Java programming lecture one
Chapter 1 Coding Introduction.
CompSci 101 Introduction to Computer Science
Advanced Programming Fall 2017.
Programming Vocabulary.
High Level Programming Languages
Unit 1: Introduction Lesson 1: PArts of a java program
Introduction CSC 111.
CSC 142 Introduction to Java [Reading: chapters 1 & 2]
Dasar-Dasar Pemrograman 2: Java Basics
Presentation transcript:

CompSci 6 Programming Design and Analysis January 17, 2006 Prof. Rodger

Announcements Read for next time Chap Homework (pre or post classwork due) Reading Quiz on Blackboard –Due beginning of class next time Bring laptops if you want starting next time Must install Eclipse and Ambient –Update if you already have it installed

History of Programming Harvard Mark 1 –1944, first automatic digital computer in US –Grace Hopper - first programmer for Mark 1 –Still at Harvard ENIAC – Eckert and Mauchly –1946, University of Pennsylvania –First useable computer

Java Developed 1995 by Sun –James Gosling and Patrick Naughton Simpler than C++ Rich and LARGE library Portable – runs on different platforms

Compiling Java Compiler –Translator from high-level language (Java) to machine language (JVM – Java virtual machine) –Path Use editor to create source file (.java) Compiler Join with class files and library files Result is code for JVM (a running program!)

What can you do with Eclipse? Almost everything! Editor Automatically compiles Identifies syntax errors Runs program Question: What is a logic error?

What will we use Eclipse for in CompSci 6? Use to write complete java programs –Access libraries Use as an editor to write text files –README – gives info about the program Use to write simple methods, then test with APT

APT – Algorithmic Program Testing Not a complete java program –No main method Focus on and solve one small problem Rich set of data for testing Use Eclipse editor for APT, but cannot compile! Why?

Chap 2 -Java Types and Variables Every value has a type: int number = 6; String month = “ January ” ; FileStream infile; Color originalColor;

Identifiers Choose meaningful names for variables, methods and classes int x = 60; // what does x represent? int numberOfDays = 6; Follow rules for identifiers Follow conventions for identifiers What is the difference?

Assignment Statement int numberOfDays; numberOfDays = 6; numberOfDays is “assigned” the value 6 OR 6 is stored in memory location for numberOfDays Don’t say –numberOfDays equals 6!

Problem Solving One-Heap Nim HingedDoor DivToZero Laundry Pancakes