ZObject-Oriented Software Development yproblem solving yprogram design and implementation yobject-oriented concepts xobjects xclasses xinterfaces xinheritance.

Slides:



Advertisements
Similar presentations
Chapter 1: Computer Systems
Advertisements

Programming Languages
COMP425M Introduction to Programming
Programming with Java. Problem Solving The purpose of writing a program is to solve a problem The general steps in problem solving are: –Understand the.
IntroductionIntroduction  Computer program: an ordered sequence of statements whose objective is to accomplish a task.  Programming: process of planning.
1 Kursusform  13 uger med: Undervisning i klassen 1,5-2 timer Opgave ”regning” i databar (løsninger på hjemmeside) En midtvejsopgave der afleveres og.
The Java Programming Language
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
INF 523Q Chapter 1: Computer Systems. 2 Focus of the Course b Object-Oriented Software Development problem solvingproblem solving program design and implementationprogram.
Outline Java program structure Basic program elements
Chapter 1 Introduction. © 2004 Pearson Addison-Wesley. All rights reserved1-2 Outline Computer Processing Hardware Components Networks The Java Programming.
COMP 14: Intro. to Intro. to Programming May 23, 2000 Nick Vallidis.
Chapter 1 Introduction.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Java Software Solutions Lewis and Loftus Chapter 2 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Software Concepts -- Introduction.
Java: Chapter 1 Computer Systems Computer Programming II Aug
Chapter 1 Introduction.
Prepared by Uzma Hashmi Instructor Information Uzma Hashmi Office: B# 7/ R# address: Group Addresses Post message:
HOW COMPUTERS MANIPULATE DATA Chapter 1 Coming up: Analog vs. Digital.
Chapter 1 Programming Languages. Application Development: Top 10 Programming Languages to Keep You Employed 1. Java 2. C# 3. C++ 4. JavaScript 5. Visual.
1 Identifiers  Identifiers are the words a programmer uses in a program  An identifier can be made up of letters, digits, the underscore character (
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley John Lewis, Peter DePasquale, and Joseph Chase Chapter 1: Introduction.
© 2004 Pearson Addison-Wesley. All rights reserved August 22, 2007 Compiling and Compiler Errors ComS 207: Programming I (in Java) Iowa State University,
© 2006 Pearson Education Computer Systems Presentation slides for Java Software Solutions for AP* Computer Science A 2nd Edition.
Java: Chapter 1 Computer Systems Computer Programming II.
Java Language and SW Dev’t
System development with Java Lecture 2. Rina Errors A program can have three types of errors: Syntax and semantic errors – called.
© 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 –
1 Introduction zNow we can begin to examine the basic ideas behind writing programs zLecture 1 focuses on: ythe structure of a Java application ybasic.
1 Computer Systems -- Introduction  Chapter 1 focuses on:  the structure of a Java application  basic program elements  preparing and executing a program.
Chapter 1 Introduction 5 TH EDITION Lewis & Loftus java Software Solutions Foundations of Program Design © 2007 Pearson Addison-Wesley. All rights reserved.
The Java Programming Language
Introduction. Objectives An overview of object-oriented concepts. Programming and programming languages An introduction to Java 1-2.
Lecture 2 Object Oriented Programming Basics of Java Language MBY.
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.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
Chapter 2: Java Fundamentals
Chapter 1: Introduction Java Programming Language How the Java Virtual Machine Works (compiling, etc…) Update by: Dan Fleck Coming up: The Java Programming.
Java The Java programming language was created by Sun Microsystems, Inc. It was introduced in 1995 and it's popularity has grown quickly since A programming.
© 2004 Pearson Addison-Wesley. All rights reserved ComS 207: Programming I Instructor: Alexander Stoytchev
Lecture 2 Software Concepts Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
1 Problem Solving b The purpose of writing a program is to solve a problem b The general steps in problem solving are: Understand the problemUnderstand.
White Space Spaces, blank lines, and tabs are collectively called white space and are used to separate words and symbols in a program Extra white space.
Instructor: Alexander Stoytchev CprE 185: Intro to Problem Solving (using C)
Programming in Java (COP 2250) Lecture 2 Chengyong Yang Fall, 2005.
Intro to Programming  Chapter 1 Part 2  Problem Solving.
Java Software Solutions Lewis and Loftus Chapter 2 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Software Concepts -- Introduction.
Chapter 1 Introduction. 2 Focus of the Course Object-Oriented Software Development problem solving program design, implementation, and testing object-oriented.
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 1: Computer Systems Presentation slides for Java Software Solutions for AP* Computer Science.
Introduction to Java Programming by Laurie Murphy Revised 09/08/2016.
Programming with Java. Chapter 1 Focuses on: –components of a computer –how those components interact –how computers store and manipulate information.
1 Problem Solving  The purpose of writing a program is to solve a problem  The general steps in problem solving are: Understand the problem Dissect the.
Working with Java.
Chapter 4 Assignment Statement
Lecture 1 Introduction Richard Gesick.
University of Central Florida COP 3330 Object Oriented Programming
1.3 Problem Solving The purpose of writing a program is to solve a problem The general steps in problem solving are: Understand the problem Dissect the.
Hardware and Software Hardware Software
null, true, and false are also reserved.
Introduction to Java Programming
An overview of Java, Data types and variables
Chapter 1: Computer Systems
Units with – James tedder
Compiling and Compiler Errors
Units with – James tedder
Java Software Solutions Foundations of Program Design 9th Edition
Focus of the Course Object-Oriented Software Development
Instructor: Alexander Stoytchev
Chap 2. Identifiers, Keywords, and Types
Presentation transcript:

zObject-Oriented Software Development yproblem solving yprogram design and implementation yobject-oriented concepts xobjects xclasses xinterfaces xinheritance xpolymorphism ythe Java programming language Focus of the Course

Problem Solving zThe purpose of writing a program is to solve a problem zThe general steps in problem solving are: yUnderstand the problem y Design test cases yDissect the problem into manageable pieces yDesign a solution yConsider alternatives to the solution and refine it yImplement the solution yTest the solution and fix any problems that exist

Problem Solving zMany software projects fail because the developer didn't really understand the problem to be solved zWe must avoid assumptions and clarify ambiguities zAs problems and their solutions become larger, we must organize our development into manageable pieces zThis technique is fundamental to software development zWe will dissect our solutions into pieces called classes and objects, taking an object-oriented approach

zA variable either holds a primitive type, or it holds a reference to an object zA class name can be used as a type to declare an object reference variable String title; zNo object has been created with this declaration zAn object reference variable holds the address of an object zThe object itself must be created separately Creating Objects

Software Categories zOperating System ycontrols all machine activities yprovides the user interface to the computer ymanages resources such as the CPU and memory yWindows 98, Windows NT, Unix, Linux, Mac OS zApplication program ygeneric term for any other kind of software yword processors, missile control systems, games zMost operating systems and application programs have a graphical user interface (GUI)

*** Binary Numbers *** zOnce information is digitized, it is represented and stored in memory using the binary number system zA single binary digit (0 or 1) is called a bit zDevices that store and move information are cheaper and more reliable if they only have to represent two states zA single bit can represent two possible states, like a light bulb that is either on (1) or off (0) zCombinations of bits are used to store values

Storage Capacity zEvery memory device has a storage capacity, indicating the number of bytes it can hold zCapacities are expressed in various units: z ****LOOK THESE UP !!! **** UnitSymbolNumber of Bytes kilobytemegabytegigabyteterabyte

The Central Processing Unit zA CPU is also called a microprocessor zIt continuously follows the fetch-decode- execute cycle: z This means that each instruction must be fetched from memory and decoded before it can be executed.

**** Errors **** zThere are three types of errors occurring in programs zThe compiler will find problems with syntax and other basic issues (compile-time errors) yIf compile-time errors exist, an executable version of the program is not created zA problem can occur during program execution, such as trying to divide by zero, which causes a program to terminate abnormally (run-time errors) zA program may run, but produce incorrect results (logical errors) zBe able to give examples of each of these

Syntax and Semantics zThe syntax rules of a language define how we can put symbols, reserved words, and identifiers together to make a valid program zThe semantics of a program statement define what that statement means (its purpose or role in a program) zA program that is syntactically correct is not necessarily logically (semantically) correct zA program will always do what we tell it to do, not what we meant to tell it to do

White Space zSpaces, blank lines, and tabs are collectively called white space zWhite space is used to separate words and symbols in a program zExtra white space is ignored zA valid Java program can be formatted many different ways zPrograms should be formatted to enhance readability, using consistent indentation

Reserved Words zThe Java reserved words: abstract boolean break byte byvalue case cast catch char class const continue default do double else extends false final finally float for future generic goto if implements import inner instanceof int interface long native new null operator outer package private protected public rest return short static super switch synchronized this throw throws transient true try var void volatile while

Comments zComments in a program are also called inline documentation zThey should be included to explain the purpose of the program and describe processing steps zThey do not affect how a program works zJava comments can take two forms: // this comment runs to the end of the line /* this comment runs to the terminating symbol, even across line breaks */

**** Bit Combinations **** zEach combination can represent a particular item zThere are 2 N combinations of N bits zTherefore, N bits are needed to represent 2 N unique items zGiven a number, be prepared to tell how many bits are required to represent it.

Java Program Structure zIn the Java programming language: yA program is made up of one or more classes yA class contains one or more methods yA method contains program statements zThese terms will be explored in detail throughout the course  A Java application always contains a method called main

16 Java Program Structure public class MyProgram {}{} // comments about the class class header class body Comments can be added almost anywhere

17 Java Program Structure public class MyProgram {}{} public static void main (String[] args) {}{} // comments about the class // comments about the method method header method body

18 **** Identifiers **** zIdentifiers are the words a programmer uses in a program zAn identifier can be made up of letters, digits, the underscore character (_), and the dollar sign zThey cannot begin with a digit  Java is case sensitive, therefore Total and total are different identifiers zIdentifiers name: constants, variables, methods, classes, etc.

Identifiers  Sometimes we choose identifiers ourselves when writing a program (such as Lincoln )  Sometimes we are using another programmer's code, so we use the identifiers that they chose (such as println ) zOften we use special identifiers called reserved words that already have a predefined meaning in the language and cannot be used in any other way (specifically, they cannot be used as names of variables, methods, classes, or constants).