Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu.

Slides:



Advertisements
Similar presentations
This is Java Jeopardy.
Advertisements

STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Introduction to Computing Concepts Note Set 7. Overview Variables Data Types Basic Arithmetic Expressions ▫ Arithmetic.
Chapter 2 Review Questions
Data Types in Java Data is the information that a program has to work with. Data is of different types. The type of a piece of data tells Java what can.
Class 7.
Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu
Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu
Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu
Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu
Introduction to Computers and Programming Lecture 7:
Working with the data type: char  2000 Prentice Hall, Inc. All rights reserved. Modified for use with this course. Introduction to Computers and Programming.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 6 Repetition Statements.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Repetition Statements.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 6 Repetition Statements.
Introduction to Python and programming Michael Ernst UW CSE 190p Summer 2012.
Identifiers and Assignment Statements. Data structures In any programming language you need to refer to data The simplest way is with the actual data.
Introduction to Java. Main() Main method is where the program execution begins. There is only one main Displaying the results: System.out.println (“Hi.
S517 Web Programming Assistant Professor Xiaozhong Liu
Chapter 2: Basic Elements of Java J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition.
Chapter 2 Practice.
Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu
CIS 260: App Dev I. 2 Programs and Programming n Program  A sequence of steps designed to accomplish a task n Program design  A detailed _____ for implementing.
3 - Variables Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
Arithmetic Operations. Review function statement input/output comment #include data type variable identifier constant declaration.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 2 Basic Elements of Java.
Mathematical Calculations in Java Mrs. G. Chapman.
Java Basics.  To checkout, use: svn co scb07f12/UTORid  Before starting coding always use: svn update.
Introduction to Python and programming Ruth Anderson UW CSE 140 Winter
PHY-102 SAPVariables and OperatorsSlide 1 Variables and Operators In this section we will learn how about variables in Java and basic operations one can.
Variables in Java x = 3;. What is a variable?  A variable is a placeholder in memory used by programmers to store information for a certain amount of.
Dialog Boxes.
1 Methods Introduction to Methods Passing Arguments to a Method More About Local Variables Returning a Value from a Method Problem Solving with Methods.
Java Programming, Second Edition Chapter Two Using Data Within a Program.
ITEC 109 Lecture 7 Operations. Review Variables / Methods Functions Assignments –Purpose? –What provides the data? –What stores the data? –What type of.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
S517 Web Programming Assistant Professor Xiaozhong Liu
Introduction to JavaScript CSc 2320 Fall 2014 Disclaimer: All words, pictures are adopted from “Simple JavaScript”by Kevin Yank and Cameron Adams and also.
A: A: double “4” A: “34” 4.
Introduction to Programming
Sum of Arithmetic Sequences. Definitions Sequence Series.
InterestRate Create an InterestRate class and InterestRateViewer client class to do the following: A person is purchasing an item with their credit card.
A data type in a programming language is a set of data with values having predefined characteristics.data The language usually specifies:  the range.
Java Programming: From Problem Analysis to Program Design, Second Edition 1 Lecture 1 Objectives  Become familiar with the basic components of a Java.
Chapter 4: Variables, Constants, and Arithmetic Operators Introduction to Programming with C++ Fourth Edition.
1 st Semester Module2 Basic C# Concept อภิรักษ์ จันทร์สร้าง Aphirak Jansang Computer Engineering.
Decisions: Conditional Statements (informally called If Statements) IST 256 Application Programming for Information Systems.
JAVA 1.COMPARISON: JAVA AND C++ 2.KEYBOARD INPUT 3.OUTPUT 4.CONVERSION FROM STRING 5.OPERATORS AND EXPRESSIONS 6.DIALOG BOX – USER PROMPT January
1 Identifiers: Names of variables, functions, classes (all user defined objects), Examples: a b gcd GCD A COSC1373 TAX Tax_Rate Tax Rate if else while.
Introduction to programming in java Lecture 21 Arrays – Part 1.
What will each of the following lines print? System.out.println("number" ); number645 System.out.println("number" + (6 + 4)+ 5); number105 System.out.println(6.
Input, Output and Variables GCSE Computer Science – Python.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Web Programming: If Statement and Servlet
2.5 Another Java Application: Adding Integers
Introduction to Python and programming
Type Conversion, Constants, and the String Object
Java Programming: From Problem Analysis to Program Design, 4e
Review Operation Bingo
Introduction to Python and programming
Introduction to Python and programming
Chapter 2: Basic Elements of Java
Introduction to Python and programming
C Programming Pointers
Unit 3: Variables in Java
Java: Variables, Input and Arrays
Data Types Every variable has a given data type. The most common data types are: String - Text made up of numbers, letters and characters. Integer - Whole.
Introduction to Python and programming
Variables and Constants
Presentation transcript:

Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu

Information problem… ???

Information problem… Input Output

Information problem… Input Variable double price, pricewithtax; price = price = price* pricewithtax = price

VariableString String name = “Obama”; String name = “Obama”; int int age = 30; int age = 30; double double price = 15.25; double price = 15.25; boolean boolean dataplan = true; (or false) boolean dataplan = true; (or false) Variable type Variable name (no space, start With alphabet, case sensitive) Variable value

Memory Model Values in the process are stored in memory. – View memory as a sequence of slots that can hold values of different types Variables name the slots, sometimes called locations of memory Assignment can put values in variables

Standard arithmetic Java supports basic arithmetic operators: +, -, *, /, and %. Add two numbers? int number1, number2, result; numbers1 = 18; number2 = 9; result =number1+number2; System,out.println(result);

double x, y; x = 7.486; y = x+15*x-7/x*x; (?????????) System,out.println(y);

Exercise: To convert from meters to feet, multiply the number of meters by meter = ???? Feet 5.68 feet = ???? meter

Exercise: Implement the following expression:

int number1 = 5; String number2 = “10”; int result; result = number1 + number2; What is the result??? Variable type conversion

double number; String str = “10.735”; number = Double.parseDouble(str) StringStringintint str = Integer.toString(num) num = Integer.parseInt(str); StringStringdoubledouble str = Double.toString(num) num = Double.parseDouble(str); Two questions: 1.What is “Double” and “Integer”??? 2. Why we need type conversion???

int number1, number2, sum; number1 = Integer.parseInt (jTextField1.getText()); number2 = Integer.parseInt (jTextField2.getText()); sum = number1 + number2; jLabel3.setText(Integer.toString(sum)); jTextField jTextField1.getText( ); jLabel jLabel3.setText (?????);

Exercise:

1.What is variable? 2.What is expression? 3.What is Standard arithmetic? 4.What is type conversion? 5.What is GUI? 6.How to add the code to GUI?