Jaeki Song ISQS6337 Lecture 01 Introduction. Jaeki Song ISQS6337 Instructor Name: Jaeki Song Office: BA 712 Office Hours Tuesday & Thursday 2:00-3:20.

Slides:



Advertisements
Similar presentations
Lecture 2 Introduction to C Programming
Advertisements

Introduction to C Programming
 2005 Pearson Education, Inc. All rights reserved Introduction.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line.
Introduction to C Programming
Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 2 1 Chapter 2 Primitive.
Chapter 2 Primitive Data Types and Operations F Introduce Programming with an Example F Identifiers, Variables, and Constants F Primitive Data Types –byte,
ITEC113 Algorithms and Programming Techniques
Primitive Data Types and Operations. Introducing Programming with an Example public class ComputeArea { /** Main method */ public static void main(String[]
1 Chapter 4 Language Fundamentals. 2 Identifiers Program parts such as packages, classes, and class members have names, which are formally known as identifiers.
 2007 Pearson Education, Inc. All rights reserved Introduction to C Programming.
Introduction to C Programming
String Escape Sequences
1 The First Step Learning objectives write Java programs that display text on the screen. distinguish between the eight built-in scalar types of Java;
1. 2 Chapter 1 Introduction to Computers, Programs, and Java.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
 2003 Prentice Hall, Inc. All rights reserved. 1 Introduction to C++ Programming Outline Introduction to C++ Programming A Simple Program: Printing a.
Java Building Elements Lecture 2 Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University
CIS Computer Programming Logic
Java Primitives The Smallest Building Blocks of the Language (corresponds with Chapter 2)
Primitive Data Types and Operations Identifiers, Variables, and Constants Primitive Data Types Byte, short, int, long, float, double, char, boolean Casting.
Chapter 2 Primitive Data Types and Operations F Introduce Programming with an Example  The MyInput class F Identifiers, Variables, and Constants F Primitive.
1 Chapter 2 Primitive Data Types and Operations F Introduce Programming with an Example  The MyInput class F Identifiers, Variables, and Constants F Primitive.
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
CSE 1301 Lecture 2 Data Types Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
Input, Output, and Processing
Jaeki Song Lecture 01 Introduction to Java Programming.
CPS120: Introduction to Computer Science
Introduction to PHP A user navigates in her browser to a page that ends with a.php extension The request is sent to a web server, which directs the request.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 2 Chapter 2 - Introduction to C Programming.
Week 1 Algorithmization and Programming Languages.
1 INTRODUCTION TO PROBLEM SOLVING AND PROGRAMMING.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 2 Basic Elements of Java.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 2: Variables & Data Types.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
CHAPTER 4 GC 101 Data types. DATA TYPES  For all data, assign a name (identifier) and a data type  Data type tells compiler:  How much memory to allocate.
Jaeki Song JAVA Lecture 02 Introduction to Java -The First Java Application-
© 2004 Pearson Addison-Wesley. All rights reserved ComS 207: Programming I Instructor: Alexander Stoytchev
Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java.
Chapter 2 Variables.
A Simple Java Program //This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { public static void main(String[]
Programming Fundamentals. Overview of Previous Lecture Phases of C++ Environment Program statement Vs Preprocessor directive Whitespaces Comments.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 2 - Introduction to C Programming Outline.
1 Week 5 l Primitive Data types l Assignment l Expressions l Documentation & Style Primitive Types, Assignments, and Expressions.
CPS120: Introduction to Computer Science Variables and Constants.
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
COP 2551 Introduction to Object Oriented Programming with Java Topics –Introduction to the Java language –Code Commenting –Java Program Structure –Identifiers.
CS 106 Introduction to Computer Science I 09 / 10 / 2007 Instructor: Michael Eckmann.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Elementary Programming.
1 1 Chapter 2 Elementary Programming. 2 2 Motivations In the preceding chapter, you learned how to create, compile, and run a Java program. Starting from.
JAVA Programming (Session 2) “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
 2003 Prentice Hall, Inc. All rights reserved Basics of a Typical C++ Environment C++ systems –Program-development environment –Language –C++
CS100Lecture 21 Announcements For homework due Thursday, work alone -- do not work in pairs New class location: Olin 155 Office hour oops! Lyn: MW, 11:15-12:15.
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
Introduction to Algorithmic Processes CMPSC 201C Fall 2000.
Primitive Data Types and Operations F Introduce Programming with an Example F Identifiers, Variables, and Constants F Primitive Data Types –byte, short,
Lecture 3: More Java Basics Michael Hsu CSULA. Recall From Lecture Two  Write a basic program in Java  The process of writing, compiling, and running.
1 Lecture 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line of Text 2.3Another Simple C Program: Adding.
1.  Algorithm: 1. Read in the radius 2. Compute the area using the following formula: area = radius x radius x PI 3. Display the area 2.
Bill Tucker Austin Community College COSC 1315
The Selection Structure
Introduction to C++ Programming
مساق: خوارزميات ومبادئ البرمجة الفصل الدراسي الثاني 2016/2015
elementary programming
Chapter 2: Introduction to C++.
Unit 3: Variables in Java
Chapter 2 Primitive Data Types and Operations
Introduction to C Programming
Presentation transcript:

Jaeki Song ISQS6337 Lecture 01 Introduction

Jaeki Song ISQS6337 Instructor Name: Jaeki Song Office: BA 712 Office Hours Tuesday & Thursday 2:00-3:20 PM or by appointment Office Phone: (806) Website:

Jaeki Song ISQS6337 Course Materials Required Textbook Deitel and Deitel, Java How to Program, 4 th Edition, Prentice Hall

Jaeki Song ISQS6337 Course Objectives Objectives –Introduce OOP using JAVA –Understand JAVA programming –Understand the issues related to web- programming using JAVA –Emphasize critical thinking about new developments

Jaeki Song ISQS6337 Grading First Exam: 20% Second Exam: 20% Third Exam: 30% Assignments: 30%

Jaeki Song ISQS6337 Course Structure Fundamentals of programming Object-oriented programming Graphics programming Developing comprehensive programming

Jaeki Song ISQS6337 Objectives B asics of Programming Language W hat is Java? I ntroduction to Java Applications

Jaeki Song ISQS6337 Programming A computer program is a set of instructions that you write to tell a computer what to do A high-level programming language allows you to use a vocabulary of reasonable terms –Each high-level language has its own syntax or rules of the language –Programmers use a computer program called compiler to translate their high-level language statements into machine code –In addition, the logic behind any program involves executing the various statements and procedures in the correct order to produce the desired results

Jaeki Song ISQS6337 Approaches Procedural programming –Defines the variable memory locations, and then calls or invokes a series of procedures to input, manipulate, and output –A single procedural programming often contains hundreds of variables and thousands of procedures calls Object-oriented programming –An extension of procedural programming –Thinking in an object-oriented manner involves envisioning program components

Jaeki Song ISQS6337 Algorithmic Thinking Correct –Using logical constructs and valid data in an organized way The steps will be carried out correctly The program will make suitable response Efficient –The program’s ability to deliver a results in a time short enough to be useful and in a space small enough An algorithm can be defined in various ways. Common ways include the use of pseudocode, flowchart, and storyboard

Jaeki Song ISQS6337 Pseudocode uses English-like phrases to describe the instructions –List the actions using keywords –Depicts logical grouping or structures using indentation MAIN MODULE: Call Initialization Call Process Call Output END PROCESS MODULE: Do While not End of File Read a record Call Calculate Call Accumulate Print Detail Line End Do RETURN CALCULATE MODULE: If Hours > 40 then Call overtime Else Call Regular time End If RETURN

Jaeki Song ISQS6337 Flow Chart Process Symbol Represent process I/O Symbol Makes data available for processing (input) or Displaying (output) of process information Decision symbol Represents a decision that determines which Of number of alternative paths is to be followed Connector symbol Represents any entry form, or exit to, another part of the flow chart Terminal symbol Represents the beginning, the end, or a point of Interruption or delay in a program

Jaeki Song ISQS6337 Storyboard Interest Calculator Principal: Interest Rate: Months: Amount Paid: Calculate Clear principalField amtlField clearButton monthslField calButton monthsLabel intLabel principalLabel intField amtLabel

Jaeki Song ISQS6337 Fundamentals of Programming Data Declaration and Assignment Relational Operators Programming Style and Documentation

Jaeki Song ISQS6337 Data Categorize data as variable or constant Constant –Data cannot be changed Variable –Data might be changed –Variable are named memory locations that your program can use to store values –Java provides eight primitive types of data Boolean, byte, char, short, long, int, float, double

Jaeki Song ISQS6337 The Int Data Type Type Minimum Value Maximum Value Size in Bytesbyte short - 32,768 32,767 2Int - 2,147,483,648 2,147,483,647 4long - 9,223,372,036,854,775,808 9,223,372,036,854,775,807 8

Jaeki Song ISQS6337 Declaration and Assignment Variable declaration –To use a variable, you declare it by telling the compiler the name of the variable as well as what type of data it represents datatype variableName e.g. int x; //Declare x to be an integer variable After a variable is declared, you can assign a value to it by using an assignment statement variable = expression; e.g. x = 1; //Assing 1 to variable x x = y + 1 ; //assign the addition of y and 1 to x –You can declare variable and initialize it in one step int x; x = 1 int x = 1;

Jaeki Song ISQS6337 Arithmetic Statements Operator Description Example+ addition 45+2, the result is 47- subtraction 45-2, the result is 43* multiplication 45*2, the result is 90/ addition 45/2, the result is 22 (not 22.5)% modulus (remainder) 45%2, the result is 1

Jaeki Song ISQS6337 The boolean Data Type Boolean logic is based on true-false comparisons Boolean variable –A variable that holds a Boolean value (true or false) Operator Name Example !Not && andtrue && true  true | |orfalse | | false  false

Jaeki Song ISQS6337 Floating-point Data Types Type Minimum Value Maximum Value Size in BytesFloat * * double * *

Jaeki Song ISQS6337 Relational Operators Relational operator Operator Name Example Answer < less than 1 < 2 true <= less than or equal to 1 <=2 true > greater than 1 > 2 false >= greater than or equal to 1 >= 2 false = = equal to 1 = = 2 false != not equal to 1 != 2 true

Jaeki Song ISQS6337 Constant A constant represents permanent data that never changes final datatype CONSTANTNAME = VALUE; In java, the world final means that the constant cannot be changed. e.g. final double PI = ;

Jaeki Song ISQS6337 Programming Style and Documentation Appropriate Comments –Every program has the following block comment appear at the top of the source code file: /*Programmer: Jaeki Song Course:ISQS 6337 File Name:Assign1XXXX.java Description:A brief description of the program */

Jaeki Song ISQS6337 Naming conventions –Make sure the meanings of the descriptive means you choose are straightforward –Names are case-sensitive For variables and methods –Use lowercase –If the name consists of several words, concatenate them into one, making the first word lowercase and capitalizing the first letter of each subsequent word e.g: calculateSalary For class names –Capitalize the first letter of each word e.g; ComputeSalary For constants –All letters are capitalized e.g.: MAX_VALUE = 10 Programming Style and Documentation

Jaeki Song ISQS6337 Programming Style and Documentation Proper indentation and spacing –Clear and easy to read e.g.: public class Test { public static void main(String args[]) { System.out.println(“Example”); }

Jaeki Song ISQS6337 Programming Errors Syntax error –Result from errors in cod construction E.g.: mistyping, omitting some necessary punctuation, using an opening brace without a corresponding closing brace Logical error –Occur when a program does not perform the way it was intended to Run-time error –Cause a program to terminate abnormally E.g. –Input error: the user enters an unexpected input value that the program cannot handle –Division by zero

Jaeki Song ISQS6337 Formatting Output Escape characters CodeConceptResult \t Horizontal tab Moves insertion point eight spaces to the right \b Backspace Moves insertion point one space to the left \n New line Moves insertion point down one line and to the left margin \r Carriage return Moves insertion point to the left margin \” Double quote Used to print a double quote character