Key Ideas from day 1 slides

Slides:



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

Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
COSC 120 Computer Programming
1 Fall 2008ACS-1903 Chapter 1 Topics Java History Java Programs Why Program? Computer Systems: Hardware and Software Programming Languages What Is a Program.
Program Flow Charting How to tackle the beginning stage a program design.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Getting Started with Java
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Computer Programming-1 CSC 111 Chapter 1 : Introduction.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Introduction to Java Lecture # Java History Green Team started by Sun Microsystems. *7 Handheld controller for multiple entertainment systems.
CIS Computer Programming Logic
Computer Programming A program is a set of instructions a computer follows in order to perform a task. solve a problem Collectively, these instructions.
1 Course Focus 1.Programming (any language) PP (Procedural Programming) OOP (Object-Oriented Programming) 2.Problem solving Understand the problem & requirements.
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
Java Programming, Second Edition Chapter One Creating Your First Java Program.
1 Problem Solving with C++ The Object of Programming Walter Savitch Chapter 1 Introduction to Computers and C++ Programming Slides by David B. Teague,
Overview of Programming and Problem Solving Textbook Chapter 1 1.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
Mrs. Ulshafer August, 2013 Java Programming Chapter 1.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
I Power Higher Computing Software Development Development Languages and Environments.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
©2016 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. CSC 110 – INTRO TO COMPUTING - PROGRAMMING Overview of Programming.
Chapter 1: Introduction to Computers and Java 1-2 Chapter Topics Chapter 1 discusses the following main topics: –Introduction –Why Program? –Computer.
CHAPTER 1 Introduction to Computers and Java Copyright © 2016 Pearson Education, Ltd.
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.
PROGRAMMING (1) LECTURE # 1 Programming and Languages: Telling the Computer What to Do.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
Chapter 1: Introduction to Computers and Programming
Chapter Goals Describe the application development process and the role of methodologies, models, and tools Compare and contrast programming language generations.
Chapter 10 Application Development
Chapter 1 Introduction 2nd Semester H
BASIC PROGRAMMING C SCP1103 (02)
Lecture 1b- Introduction
Development Environment
Introduction to Programming and Visual Basic
Lecture 1 Introduction Richard Gesick.
CSCI-235 Micro-Computer Applications
Lecture 1: Introduction to JAVA
BASIC PROGRAMMING C SCP1103 (02)
Introduction to Computers and Java
Chapter 1: Introduction to Computers and Java
TRANSLATORS AND IDEs Key Revision Points.
Chapter 1: Introduction to Computers and Programming
Computer Programming.
Control Structures (Structured Programming) for controlling the procedural aspects of programming CS1110 – Kaminski.
Introduction CSC 111.
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Chapter 1 Introduction(1.1)
The Programming Process
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Creating Computer Programs
CS 1111 Introduction to Programming Spring 2019
ICT Gaming Lesson 2.
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Control Structures (Structured Programming) for controlling the procedural aspects of programming CS1110 – Kaminski.
Computer Programming-1 CSC 111
Creating Computer Programs
ICS103 Programming in C 1: Overview of Computers And Programming
IS 135 Business Programming
Programming Logic and Design Eighth Edition
Presentation transcript:

Key Ideas from day 1 slides CS1110 - Kaminski

Program (app) Software Program recipe Makes computer “smart” controls HW hides most HW (& low-level SW) from user solution to a problem Program recipe detailed step-by-step set of instructions tells computer exactly what to do processes data

Programming = Problem solving Understand problem & requirements - I P O Design modular program Design algorithms Code solution Test & debug

algorithm written in pseudocode (or flowchart or . . .) pseudocode implemented in high level language (Java or …) (source code) source code translated into machine language (all 0’s and 1’s) by a compiler

IPO (IPSO) Input  Processing  Output & Storing

IPO (IPSO) HUMAN HW SW see/hear  think & remember  speak/write mouse/KB …  CPU & RAM & disk  screen, … SW data  process & store  data (user/file/DB) (user/file/DB) ^^^^^^^^^^^^^ “the PROGRAM”

IPO (IPSO) PROGRAM program’s METHOD user input  process & store  screen display mouse clicks   DB data in a form  program’s METHOD input parameters  procedure  return value [& local variables] [& class’s instance variables]

Modular programming Program = a collection of small modules module: (in Procedural Programming) an IPSO procedure (or function) (in Object Oriented Programming) a Class (object) a IPSO method (~ a procedure) in a class Programming = write modules Top-down or bottom-up

Structured Programming methods made from STACKING & NESTING: Sequence do action1 do action2 ... 2) Selection if conditionX is true then do action1 ... else do action2 ... 3) Repetition while conditionY is true then { do action1 }

Procedural Programming (PP) program = set of procedures procedure (= method) NAMED set of statements which do a specific task procedure data passed IN to it (from caller) it PROCESSES data it sends results data OUT (to caller)

Object-Oriented Programming (OOP) focus: create objects (vs. procedures) Object = both Data = attributes of object Procedures = methods - behaviors of object - services users of object might need

Programming Determine: = problem-solving   solution WHAT needs to be done HOW to do it (algorithm) = problem-solving   solution Solve the right problem AND Solve the problem right

Steps in programming Requirements specification [what] I P O Program design [how] I P S O, algorithm, modules, GUI Coding [Java] Test & debug compile errors / logic errors / runtime errors validate output results Document Maintenance

A Good Program gives correct output follows client/designer’s specs functionality output runs fast is compact (space) clear & easy to change

Algorithm (P of IPSO) EXAMPLE: find sum of 1st 100 integers User view: BLACK box Programmer view: WHITE (“clear”) box ( actual code) Which algorithm? Look up - table / file / DB Ask - crowdsource micro-task on internet Calculate – Algor. A 1 + 2 + 3 + … + 100 Calculate – Algor. B (100 * (100+1)) / 2

Basic Program Operations 1) Actual Work arithmetic (+ - * / %) comparison ( == < > and, or, not) 2) Move/store data Assignment (=) memory  memory I/O (read) keyboard /mouse/touchscreen/file/…  memory I/O (write) memory  screen/printer/file/…

3) Control flow (next instruction to run) default: next line maybe do next line(s) (if, switch) do next line(s) multiple times (loop) go to line elsewhere & return here (call) 4) Packaging method headers class headers

Why Java? “cross platform” - portable program written for 1 type of device/HW/OS runs on ANY OTHER device/HW/OS without rewriting/recompiling program

Compiler (traditional) Compiler = a program (IPO) translates: Input data: source code file Output data: machine language file also finds syntax errors spelling, grammar, structure errors that violate rules of that language .

for a specific CPU / OS [simplistically] write program in high-level lang. (BASIC, C, C++, COBOL,…) using text editor or IDE save it as a source code file compiler translates source code file into executable code file (SomeProgramName.exe) for a specific CPU / OS [simplistically]

Java compiler compiler translates Java source file (.java) into file containing byte code instructions (.class) byte code instructions: the “machine language” of the Java Virtual Machine (JVM) [these can NOT be executed directly by a CPU]

JVM program that emulates a hardware CPU JVM executes each byte code instruction, as it’s read (unlike a compiler that produces .exe file) Java = an interpreted language

Program Development Text editor (or IDE) Source code (.java) saves Java statements Java compiler (javac) is read by Byte code (.class) produces Java Virtual Machine (java) is interpreted by Program Execution results in

Java programs portable program written for 1 type of computer runs on wide variety of computers (with little/no modification) (e.g., applets from web) “compiled” Java .class program portable specific JVM’s exist for many platforms: Windows, Mac, Linux, etc.

2 ways to compile Java program command-prompt (B&W) window javac is Java compiler (for specific JVM) to compile: javac SomeProgram.java IDE automates (& hides) this icon to build (instead of compile) automatic build when program is run