Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu https://xliu12.mysite.syr.edu.

Slides:



Advertisements
Similar presentations
Copyright © 2002 Pearson Education, Inc. Slide 1.
Advertisements

Etter/Ingber Arrays and Matrices. Etter/Ingber One-Dimensional Arrays 4 An array is an indexed data structure 4 All variables stored in an array are of.
Introduction to Programming
Chapter 8: Arrays.
What is output line of the following C++ code? Please trace int i = 1, QP; DATA: 4, B, 3, A double credit, totCredit=0.0; double num = 0.0; string LG;
Functions Prototypes, parameter passing, return values, activation frams.
CS 1031 Recursion (With applications to Searching and Sorting) Definition of a Recursion Simple Examples of Recursion Conditions for Recursion to Work.
Introduction to Programming Lecture 15. In Today’s Lecture Pointers and Arrays Manipulations Pointers and Arrays Manipulations Pointers Expression Pointers.
Hand Trace and Output for: int digit = 0; int number = 1423; do { digit = number % 10; System.out.println(digit); number = number / 10; } while (number.
An Introduction to Hashing. By: Sara Kennedy Presented: November 1, 2002.
SELECTION II CSC 171 FALL 2004 LECTURE 9. Sequential statements start end Block{…}
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming Introduction to Arrays.
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 Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu
Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu
Character Input and Output C and Data Structures Baojian Hua
1 11/27/06CS150 Introduction to Computer Science 1 Searching Arrays.
Function Overloading Can enables several functions Of same name Of different sets of parameters (at least as far as their types are concerned) Used to.
1 6/20/2015CS150 Introduction to Computer Science 1 Functions Chapter 6, 8.
1 More on Arrays Passing arrays to or from methods Arrays of objects Command line arguments Variable length parameter lists Two dimensional arrays Reading.
Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu
©2004 Brooks/Cole Chapter 8 Arrays. Figures ©2004 Brooks/Cole CS 119: Intro to JavaFall 2005 Sometimes we have lists of data values that all need to be.
Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu
Arrays. Objectives Learn about arrays Explore how to declare and manipulate data into arrays Learn about “array index out of bounds” Become familiar with.
Character Input and Output
Arrays.
Introduction to Methods. How do we use Methods in Java? Let us start by creating one which displays “hello” on Dos Prompt.
ARRAYS In this Lecture, we will try to develop understanding of some of the relatively complex concepts. The following are explained in this lecture with.
EGR 2261 Unit 8 One-dimensional Arrays  Read Malik, pages in Chapter 8.  Homework #8 and Lab #8 due next week.  Quiz next week.
Arrays and ArrayLists in Java L. Kedigh. Array Characteristics List of values. A list of values where every member is of the same type. Each member in.
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.
Array Cs212: DataStructures Lab 2. Array Group of contiguous memory locations Each memory location has same name Each memory location has same type a.
Arrays Chapter 8. What if we need to store test scores for all students in our class. We could store each test score as a unique variable: int score1.
I Power Int 2 Computing Software Development High Level Language Constructs.
© 2004 Pearson Addison-Wesley. All rights reserved October 13, D Arrays ComS 207: Programming I (in Java) Iowa State University, FALL 2006 Instructor:
CHAPTER 7 arrays I NTRODUCTION T O C OMPUTER P ROGRAMMING (CSC425)
Chapter 8: Arrays and Functions Department of Computer Science Foundation Year Program Umm Alqura University, Makkah Computer Programming Skills
CompSci Arrays  Aggregate data type  Deal with items of same type  Lists of words  Numbers  Analogies  Mailboxes in post office  CD racks.
1 Traversal algorithms. 2 Array traversal traversal: An examination of each element of an array. Traversal algorithms often takes the following form:
Enhanced For Loops (For Each Loops) Less Code and Less Overhead for Writing For Loops.
Advanced Computer Science Lesson 4: Reviewing Loops and Arrays Reading User Input.
Introduction to C Programming Lecture 6. Functions – Call by value – Call by reference Arrays Today's Lecture Includes.
CS 139-Programming Fundamentals Lecture 11B - Arrays Adapted from a presentation by Dr. Rahman Fall 2014.
Composition When one class contains an instance variable whose type is another class, this is called composition. Instead of inheritance, which is based.
Introduction to Functions.  A complex problem is often easier to solve by dividing it into several smaller parts, each of which can be solved by itself.
Two Dimensional Arrays Found in chapter 8, Section 8.9.
P OINTERS A pointer is an address All data is stored in memory in some location that is indexed with an address Can refer to variables by name or by memory.
Midterm Review Tami Meredith. Primitive Data Types byte, short, int, long Values without a decimal point,..., -1, 0, 1, 2,... float, double Values with.
© Janice Regan, CMPT 128, January CMPT 128: Introduction to Computing Science for Engineering Students Introduction to Arrays.
1 st Semester Module 7 Arrays อภิรักษ์ จันทร์สร้าง Aphirak Jansang Computer Engineering Department.
For Friday Read No quiz Program 6 due. Program 6 Any questions?
Chapter 9 Introduction to Arrays Fundamentals of Java.
Arrays. What is an array? An array is a collection of data types. For example, what if I wanted to 10 different integers? int num1; int num2; int num3;
Introduction to programming in java Lecture 21 Arrays – Part 1.
Practice + Method Xiaozhong Liu
Two Dimensional Array Mr. Jacobs.
Register Use Policy Conventions
Introduction to Application Programming
The switch statement: an alternative to writing a lot of conditionals
Java Lesson 36 Mr. Kalmes.
Arrays.
Building Java Programs
Python Basics with Jupyter Notebook
Fundamental Programming
IPC144 Introduction to Programming Using C Week 5 – Lesson 1
Programming Arrays.
More Basics of Python Common types of data we will work with
Presentation transcript:

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

Read the following code: double number; String result; If (number >= 5) { result = “good” } else { result = “bad” } number = 5.0; System.out.println(result);

Read the following code: double salary, taxrate, income; salary = if (salary >= 3000) { taxrate = 0.30; } else { if (salary >= 2000) { taxrate = 0.20; } else { taxrate = 0.10; } income = salary * (1 - taxrate); System.out.println(income);

Read the following code: double hours, rate, salary; String position = “manager”; hours = 40; If (position.equals(“manager”) || hours > 40) { rate = 80; } else { If (position.equals(“employee”) || hours > 40) { rate = 60; } else { rate = 40; } salary = hours * rate

Read the following code: int result, step; step = 1; result = 20; While (result > 10) { result = result – step; if (step%2 == 0) { step = step - 1; } else { step = step + 1; } System.out.println(result);

Read the following code: int total = 0; for (int index = 1; index < 17; index++) { total = total + 3; } System.out.println(total);

Read the following code: Design a method Parameters: an array of integers - num[]; an integer – rate. The method should return a new array with each element enlarged [rate] times.

Read the following code: Suppose Syracuse University wants to expand student number 1.5% every year. Input the “current student number” and “years”; predict the number of students in the future (years number later).