Your First Data Structure: 1D Array Shirley Moore CS 1401 Spring 2013 cs1401spring2013.pbworks.com April 9-11, 2013.

Slides:



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

Scribe, individual conferences, Monday: No School Tuesday: Scribe, Writing Lab day, individual conferences, review thesis(check blog postings), SAT 2,
Exception Handling Shirley Moore CS 1401 Spring 2013 cs1401spring2013.pbworks.com May 7,
Aalborg Media Lab 2-May-15 Exercises/Summary Lecture 10 Summary, Exercises.
CIS101 Introduction to Computing Week 11 Spring 2004.
CS 117 Spring 2002 More Classes. IEEE Student Conference Student Professional Awareness Conference –Paul Kostek: career options for 21st Century –Panel.
CS2420: Lecture 1 Vladimir Kulyukin Computer Science Department Utah State University.
CSSE221: Software Dev. Honors Day 27 Announcements Announcements Projects turned in? Projects turned in? The 2 required Angel surveys are due by 9 pm tonight.
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)
Programming Assignment #4 CS-2301, B-Term Programming Project #4 Arrays and Pointers Due, November 24, 11:59 PM (Assignment adapted from C: How to.
©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.
CS 106 Introduction to Computer Science I 03 / 03 / 2008 Instructor: Michael Eckmann.
Using Templates Object-Oriented Programming Using C++ Second Edition 11.
Wednesday, 11/6/02, Slide #1 CS 106 Intro to CS 1 Wednesday, 11/6/02  QUESTIONS?? – HW # 4 due Monday  Today:  Return HW #3  Arrays (Chap. 10)  Reading:
LAB-10 1-D Array I Putu Danu Raharja Information & Computer Science Department CCSE - King Fahd University of Petroleum & Minerals.
Selection and Testing Shirley Moore CS 1401 Spring 2013 February 21 and 26,
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the basic concepts and uses of arrays ❏ To be able to define C.
1 CS1130 Spring 2011: David Gries & Walker White Transition to Object-Oriented Programming Assumes programming knowledge in a language like Matlab, C,
CS1101: Programming Methodology Aaron Tan.
CPS 2231 Computer Organization and Programming Instructor: Tian (Tina) Tian.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Arrays COMP 102 # T1.
Introduction to Managerial Accounting Richard E. McDermott, Ph.D. Spring 2013.
COE Computer Organization & Assembly Language Talal Alkharobi.
 2004 Prentice Hall, Inc. All rights reserved. 1 Chapter 11 - JavaScript: Arrays Outline 11.1 Introduction 11.2 Arrays 11.3 Declaring and Allocating Arrays.
General Physics Lecture 1 1 Welcome to Phys 130! Blackboard blackboard.siena.edu.
1 DATA STRUCTURES: LISTS. 2 LISTS ARE USED TO WORK WITH A GROUP OF VALUES IN AN ORGANIZED MANNER. A SERIES OF MEMORY LOCATIONS CAN BE DIRECTLY REFERENCED.
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.
Week 91 Introduction to Programming Ms. Knudtzon C Period Quarter 2 – Lecture 20 Monday, November 1 st.
Java Script: Arrays (Chapter 11 in [2]). 2 Outline Introduction Introduction Arrays Arrays Declaring and Allocating Arrays Declaring and Allocating Arrays.
CS 140 Computer Programming (I) Second semester (3 credits) Imam Mohammad bin Saud Islamic University College of Computer Science and Information.
Simulation Time-stepping and Monte Carlo Methods Random Number Generation Shirley Moore CS 1401 Spring 2013 March 26, 2013.
1 CS Programming Languages Class 15 October 17, 2000.
CSE 1340 Introduction to Computing Concepts Class 1 ~ Intro.
Course Introduction Bryce Boe 2013/09/30 CS24, Fall 2013.
Number Representation, Data Types and Elementary Programming Shirley Moore CS 1401 February 5-7, 2013.
Ch. 10 For Statement Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2012.
Physics 2053 General Physics I.
Using MyMathLab Features of MyMathLab You must already be registered or enrolled in a current MyMathLab class in order to use MyMathLab. If you are not.
CompSci 6 Introduction to Computer Science Sept 29, 2011 Prof. Rodger “All your troubles are due to those ‘ifs’,” declared the Wizard. If you were not.
Introduction to C Programming Lecture 6. Functions – Call by value – Call by reference Arrays Today's Lecture Includes.
1 Chapter 7 Arrays. 2 Topics 7.1 Arrays Hold Multiple Values 7.2 Accessing Array Elements 7.3 No Bounds Checking in C Array Initialization 7.5 Processing.
Homework #2: Functions and Arrays By J. H. Wang Mar. 20, 2012.
MGS 351 Introduction to Management Information Systems RECITATION 8.
Today’s Agenda is…. Pre-algebra Friday, October 16 (Homework-Skill 5-No Calculators- is due on Friday) 1.Check Homework 2.Quiz to improve grades. 3.Write:
CSS 290: Video Games and Computer Programming. CSS 2902 Reading: Conditional Statements PLAD, Chapter 5 (“Repetition Structures”) –5.1: Overview –5.2:
Introduction to Methods Shirley Moore CS 1401 Spring 2013 cs1401spring2013.pbworks.com April 1, 2013.
Function Overloading Two different functions may have the same name as long as they differ in the number or types of arguments: int max(int x, int y) and.
1 Printing in Python Every program needs to do some output This is usually to the screen (shell window) Later we’ll see graphics windows and external files.
11/5/2016CS150 Introduction to Computer Science 1 Announcements  Assignment 6 due on Wednesday, December 3, 2003  Final Exam on Tuesday, December 9,
Week 2 - Friday.  What did we talk about last time?  Computing Big Oh.
CompSci 101 Introduction to Computer Science February 10, 2015 Prof. Rodger “All your troubles are due to those ‘ifs’,” declared the Wizard. If you were.
U.S. History Group Project.  In the remaining weeks of school, you, the students, will be put in the position of teacher. You will be broken up into.
CSE 1340 Introduction to Computing Concepts Class 1 ~ Intro.
Week 6 - Friday.  What did we talk about last time?  Loop examples.
More on Variables and Subroutines. Introduction Discussion so far has dealt with self- contained subs. Subs can call other subs or functions. A module.
Pointers A pointer type variable holds the address of a data object or a function. A pointer can refer to an object of any one data type; it cannot refer.
CS 31 Discussion, Week 7 Faisal Alquaddoomi, Office Hours: BH 2432, W 4:30-6:30pm, F 12:30-1:30pm.
Lecture 17: 4/4/2003CS148 Spring CS148 Introduction to Programming II Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
Searching and Sorting Arrays Shirley Moore CS 1401 Spring 2013 cs1401spring2013.pbworks.com April 15-16, 2013.
CompSci 101 Introduction to Computer Science February 16, 2016 Prof. Rodger “All your troubles are due to those ‘ifs’,” declared the Wizard. If you were.
CS 1428 Final Exam Review. Exam Format 200 Total Points – 60 Points Writing Programs – 45 Points Tracing Algorithms and determining results – 20 Points.
Class Definitions: The Fundamentals Chapter 6 3/30/15 & 4/2/15 Imagine! Java: Programming Concepts in Context by Frank M. Carrano, (c) Pearson Education.
Your First Data Structure: 1D Array Shirley Moore CS 1401 Spring 2013 cs1401spring2013.pbworks.com April 9, 2013.
Introduction to Classes and Objects Shirley Moore CS 1401 Spring 2013 cs1401spring2013.pbworks.com April 23, 2013.
CompSci 101 Introduction to Computer Science
One-Dimensional Array Introduction Lesson xx
Chapter 8 Arrays Objectives
Best Practices for Teaching Online
Chapter 8 Arrays Objectives
Data Structures & Algorithms
Presentation transcript:

Your First Data Structure: 1D Array Shirley Moore CS 1401 Spring 2013 cs1401spring2013.pbworks.com April 9-11, 2013

Agenda Announcements Recap Exam 2 last two problems (TR only) Recap Quiz 5 (TR only) Introduction to Arrays Assignments for next class Intro to Lab 7

Announcements CS Seminar – April 12, :00-2:00 PM in CCSB G.0208 – Guillaume Melquiond, Universite Paris Sud – Title: Formal proof and interval arithmetic, a virtuous circle CS Seminar – April 16, :00-3:00 PM in CCSB (Conference Room) – Maria Eskevich, Dublin City University – Title: Focus on Spoken Content in Multimedia Retrieval Grades for quizzes, labs, and exams on BlackBoard Turn in Quiz 5 redo (if you took it the first time) (TR only) Quiz 6 on Monday, April 15; Tuesday, April 16 Exam 2 retest on last two problems Thursday, April 11 (TR only) First research paper due by April 25

Arrays After completing this lesson, students will be able to – declare and create arrays – access and manipulate array elements, including in loops – use arrays in programs, including as method arguments

Motivating Example: Standard Deviation Suppose you want to read in a set of values, compute the mean and the standard deviation, and report how many values are within one standard deviation of the mean. See deviation.html for definitions. deviation.html We need to store the values as we read them in and then be able to process them.

Class Activity Complete the program DogHeights.java (download from class website)

Arrays and Methods Arrays can be passed to and returned by methods. Examples from class website: – ArrayFun.java Add a main program that – randomly fills an array and calls PrintList to print it – calls ReverseList to generate a list in the reverse order and calls PrintList to print it. Add a method ReverseListInPlace() that reverses the list in place. Call this method from your main program and then call PrintList to print the reversed list. – Swap.java – Why does the array version work while the scalar version doesn’t?

Overloaded Array Methods Let’s revisit DogHeights.java Implement an overloaded method for mean that takes an integer array as the first argument and an optional second argument that tells the number of items in the array (default is the length of the array). Implement an overloaded method for standard deviation that takes an integer array as the first argument, an optional second argument that tells the number of items, and an optional third argument that passes in the mean of the array. Rewrite the program to use these methods. Suppose you wanted to use the same method name for the mean of an array but have it work for both integer and double arrays. How could you do this?

Assignments for Next Class Read textbook sections , , 6.9 Programming Exercises (at the end of the chapter) 6.2, 6.6*, 6.12, 6.13