COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 14 – How to Complete Assignment 2, Part III Webpage:

Slides:



Advertisements
Similar presentations
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 32 – Java Graphical User Interfaces (GUIs) Webpage:
Advertisements

Introduction to arrays
Introduction to Programming Lecture 15. In Today’s Lecture Pointers and Arrays Manipulations Pointers and Arrays Manipulations Pointers Expression Pointers.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 09 – Programming with Java Datatypes and Flow Control.
CSC 107 – Programming For Science. Today’s Goal  Get familiar with multi-dimensional arrays  Creating variables for multi-dimensional array  Multi-dimensional.
Review. In this lecture we will review and fill in loose ends regarding… Variables and how to name them Floating point data types Deciding what type to.
Wednesday, 12/11/02, Slide #1 CS 106 Intro to Comp. Sci. 1 Wednesday, 12/11/02  QUESTIONS??  Today: CLOSING CEREMONIES!  HW #5 – Back Monday (12/16)
11-1 Chapter 11 2D Arrays Asserting Java Rick Mercer.
CS Data Structures Chapter 2 Arrays and Structures.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 11P. 1Winter Quarter Arrays Lecture 11.
Two-Dimensional Arrays School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 11, Friday 4/04/2003)
R-1 University of Washington Computer Programming I Lecture 17: Multidimensional Arrays © 2000 UW CSE.
Arrays. 2 The array data structure An array is an indexed sequence of components Typically, the array occupies sequential storage locations The length.
Arrays (Part II). Two- and Multidimensional Arrays Two-dimensional array: collection of a fixed number of components (of the same type) arranged in two.
1 Session-13 CSIT 121 Spring 2006 Test-1 is on March 9 th ; Demo-5 due date extended to March 7 Test-1 is on March 9 th ; Demo-5 due date extended to.
CSE 115 Week 2 January , Wednesday Announcements Pick up Syllabus if you need one Pick up Syllabus if you need one Recitation Change Form.
Spring 2012 MATH 250: Calculus III. Course Topics Review: Parametric Equations and Polar Coordinates Vectors and Three-Dimensional Analytic Geometry.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the basic concepts and uses of arrays ❏ To be able to define C.
COMP 151: Computer Programming II Spring Course Topics Review of Java and basics of software engineering (3 classes. Chapters 1 and 2) Recursion.
ISAT 252 Introduction to Arrays. Should have read 2 Chapter 8 –pp , and pp
Chapter 9: Advanced Array Concepts
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 13 – Having Fun with Arrays in Java Webpage:
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
COSC 1P03 Introduction to Data Structures 1.1 COSC 1P03  Audience  planning to major in COSC (prereq. 1P02 60%)  Lectures (AS202, AS217), labs (J301),
© 2004 Pearson Addison-Wesley. All rights reserved October 17, 2007 Searching (part 2) ComS 207: Programming I (in Java) Iowa State University, FALL 2007.
Lecture Contents Arrays and Vectors: Concepts of array. Memory index of array. Defining and Initializing an array. Processing an array. Parsing an array.
L. Grewe.  An array ◦ stores several elements of the same type ◦ can be thought of as a list of elements: int a[8]
Arrays Part 9 dbg. Arrays An array is a fixed number of contiguous memory locations, all containing data of the same type, identified by one variable.
ARRAYS 1 Week 2. Data Structures  Data structure  A particular way of storing and organising data in a computer so that it can be used efficiently 
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Searching Arrays Searching.
Introduction to Information and Computer Science Computer Programming Lecture b This material (Comp4_Unit5b), was developed by Oregon Health and Science.
1 CSC 222: Computer Programming II Spring 2004 See online syllabus at: Course goals:
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 10 – Programming with Java Datatypes Type Casting.
Computer Programming 12 Mr. Jean April 24, The plan: Video clip of the day Upcoming Quiz Sample arrays Using arrays More about arrays.
CSC 107 – Programming For Science. Today’s Goal  When lecture over, start understanding pointers  What a pointer is and what it is not  Why pointers.
CSC 107 – Programming For Science. Today’s Goal  When lecture over, start understanding pointers  What a pointer is and what it is not  Why pointers.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 35 – Overview of Java Web Programming Webpage:
Computer Science: A Structured Programming Approach Using C1 8-7 Two-Dimensional Arrays The arrays we have discussed so far are known as one- dimensional.
Introduction to C++ Programming Language Assistant Professor Jeon, Seokhee Assistant Professor Department of Computer Engineering, Kyung Hee University,
1 Topic: Array Topic: Array. 2 Arrays Arrays In this chapter, we will : Learn about arrays Learn about arrays Explore how to declare and manipulate data.
© 2004 Pearson Addison-Wesley. All rights reserved October 15, 2007 Searching ComS 207: Programming I (in Java) Iowa State University, FALL 2007 Instructor:
1 Objectives ❏ To understand the basic concepts and uses of arrays ❏ To be able to define C arrays ❏ To be able to pass arrays and array elements to functions.
***** SWTJC STEM ***** Chapter 7 cg 68 What Are Arrays? An array is a simple but powerful way to organize and store large amounts of data and information.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 11 – How to Get Started on Assignment #2 Webpage:
CMSC 2021 CMSC 202 Computer Science II for Majors Spring 2002 Sections Ms. Susan Mitchell.
Arrays Chapter 8. Overview u General discussion u Variable arrays u Control arrays u Multi-dimensional variable arrays  Two-dimensional  Three-dimensional.
EGR 115 Introduction to Computing for Engineers MATLAB Basics 1: Variables & Arrays Wednesday 03 Sept 2014 EGR 115 Introduction to Computing for Engineers.
Computer Science: A Structured Programming Approach Using C1 8-7 Two-Dimensional Arrays The arrays we have discussed so far are known as one- dimensional.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 20 – Inheritance and Polymorphism in Java Webpage:
CSC Programming for Science Lecture 28: Multi-dimensional Arrays.
Arrays.
Engineering Computing I Chapter 5 Pointers and Arrays.
Arrays Chapter 7. 2 Declaring and Creating Arrays Recall that an array is a collection of elements all of the _____________ Array objects in Java must.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 06 – Java Datatypes Webpage:
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 39 – Command Line Args & Recursion Webpage:
CSC Programming for Science Lecture 27: Arrays as Parameters, Searching, & Sorting.
Scis.regis.edu ● CS-362: Data Structures Week 6 Part 2 Dr. Jesús Borrego 1.
January 10, Csci 2111: Data and File Structures Instructor: Nathalie Japkowicz Objectives of the Course and Preliminaries.
BIT 115: Introduction To Programming Professor: Dr. Baba Kofi Weusijana (say Doc-tor Way-oo-see-jah-nah, Doc-tor, or Bah-bah)
CSC Programming for Science Lecture 26: Arrays.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 7A Arrays (Concepts)
Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Third Edition by Tony Gaddis.
Introduction to Programming Lecture 12. Today’s Lecture Includes Strings ( character arrays ) Strings ( character arrays ) Algorithms using arrays Algorithms.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 08 – Hand-On Work: Assignment 1, Part III Webpage:
Beginning C for Engineers Fall 2005 Arrays, 2-D arrays, character strings Bettina Schimanski Lecture 5: Section 2 (9/28/05) Section 4 (9/29/05)
COP2800 – Computer Programming Using JAVA
Haidong Xue Summer 2011, at GSU
COMS W1004 Introduction to Computer Science and Programming in Java
Arrays Week 2.
1.4 ทบทวน JAVA OO Programming Concepts Declaring and Creating Objects
Presentation transcript:

COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 14 – How to Complete Assignment 2, Part III Webpage:

COP2800 – Programming in JAVA Course Objectives – Basic Knowledge of Computers & Programming – Specific Knowledge of JAVA Programming – Practical Programming Projects Build Skills Today’s Class – The Concept of Number Filtering – How to Complete Assignment 2 Building Classes for Part III Adding/Modifying Methods

Review: Java Program Structure HIGH-LEVEL VIEW JAVA Units: -Packages -Classes (Instances) -Methods -Instructions -Variables PICTURE CREDIT:

Review: Java Package Structure PICTURE CREDIT:

What Is An Array? Arrays Are Regular, periodic data structures 1-D : A vector of values (1,4,37,3) 2-D : A matrix (like mailboxes at the Post Office) Arrays Are Used For Storing Values for Regular Accessibility Sorting and Searching Regularizing Variable-Length Data

Assignment 2: The “Bins” Array Two-Dimensional Array: Array Name = “Bins” // Declare array (2-D, NBins rows x 4 cols) float a2[][] = new float[NBins][3] ; Anatomy: Dimension #1 = Bin Number (from 0 to Nbins-1) Dimension #2 = Parameters: 1 – Lower Bound of Test Interval 2 – Upper Bound of Test Interval 3 – Count of Numbers in Bin

The “Bins” Array (Asn-2), cont’d Two-Dimensional Array: Array Name = “Bins” Bin Number Parameter #1 Parameter #2 Parameter #3 Lesson Learned: Arrays can be used for storing input parameters and results.

How the “Bins” Array Works Number-Line Interval Is Defined By: -- Lower BoundBins[0][0] = -- Upper Bound Bins[0][1] = Interval from -10 to 0 writ- ten as [-10,0] x =  Bin CountBins[0][2] = Bins[0][2] + 1 incremented because x = is within [-10,0].

How NumberFilter Works Number-Line Interval Defined By: -- Lower Bound Bins[0][0] = -- Upper Bound Bins[0][1] = Test Number x = Pseudocode: (for the i th Bin Bins[i][…]) if x > LowerBound AND x < UpperBound then { x is in the i th interval so we increment the i th bin_count } else we try the next value of i or get next x if bin-loop ends

This Week: Arrays and Java READING ASSIGNMENT: D. Liang: Chapters 6 & 7 By now, you should have read textbook Ch. 1-8 Today (Friday 8 Feb 2013): How to Do Assignment #2 – Part III More on Multidimensional Arrays in Java Monday 11 Feb 2013: New Topic: READ LIANG CHAPTER 9

Happy Weekend!! Image Credit: