SE1011 Week 9, Class 3 Today Arrays with Loops! Homework SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 1.

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming Lecture 5 Array and Collections.
Advertisements

Java Unit 9: Arrays Declaring and Processing Arrays.
CS2852 Week 8, Class 2 Today Tree terminology Non-Binary and Non-Search Trees Tree Traversals (Remaining slides not yet shown) Tomorrow: Quiz Implementing.
Problem Solving using the Java Programming Language May 2010 Mok Heng Ngee Day 5: Arrays.
CS2910 Week 1, Class 3 Today Lab 1 – Additional Assignment Working Ahead Primitives in Java SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder.
SE1011 Week 2, Class 3 Today Compiling and running Another example using Scanner Compile-time and Run-time errors Review for exam SE-1011 Slide design:
CS 206 Introduction to Computer Science II 09 / 10 / 2009 Instructor: Michael Eckmann.
Week 6, Class 1 & 2: Decorators Return Exam Questions about lab due tomorrow in class? Threads Locking on null object invokeLater & the squares example.
CS2910 Week 1, Class 2 Today Announce Prof. Michael Vieau’s S-341 6p Thurs Wk 2 Assignment for tomorrow Data Encoding, Part 1 Parsing Data Muddiest Point.
CS2910 Week 1, Class 1 Today Introductions Class/Lab Layout Safety Review - Note about Lab Safety Review Announce Prof. Michael Vieau’s S-341 6p Thurs.
SE-1010 Dr. Mark L. Hornick 1 Java Programming Basics.
CS-2852 Data Structures Week 5, Class 1 – Testing and Stacks Return Exams & Labs  Package-level access  UML connectors for instance variables Announcement:
CS2910 Week 2, Class 1 Today Data Encoding, Part 1 Parsing Data Python Muddiest Point Lab 2 – Bring text In Class, Thursday: Quiz Week 6, Monday: Midterm.
The Singleton Pattern SE-2811 Dr. Mark L. Hornick 1.
CS2852 Week 3, Class 2 Today Stacks Queues SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
SE1011 Week 8, Class 3 Today Designing Code SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 1.
SE1011 Week 6, Class 1 Today Return Half Exam 2 (cont.) Object Oriented Programming (cont.) Muddiest Point Next Half Exam: Week 7, Monday SE-1011 Slide.
SE1011 Week 6, Class 2 Today Return Half Exam 2 (cont.) Object Oriented Programming (cont.) UML class diagrams Muddiest Point Next Half Exam: Week 7, Monday.
CS2910 Week 2, Class 1 Today Return Lab 1 Muddiest Points Quiz Parsing Data in Python SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
CS2852 Week 6, Class 1 Today The run-time stack Writing and proving recursive methods SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
CS2852 Week 5, Class 2 Today Queue Applications Circular Queue Implementation Testing SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
SE1011 Week 6, Class 2 Today Return Half Exam 2 (cont.) Object Oriented Programming (cont.) UML class diagrams Muddiest Point Next Half Exam: Week 7, Monday.
SE1011 Week 3, Class 2 Today Sit down by someone you don't know Learn their name Find out who came farther to get to MSOE at the start of the quarter Designing.
SE1011 Week 5, Class 1 Today More Java API tools Packages Object Oriented Programming Muddiest Point Tomorrow: Lab 5 – In-lab demo requirements now up.
CS2852 Week 7, Class 1 Today Binary Search Tree Implementing add Implementing find Return Quiz 4 (second attempt) Both sections are graded SE-2811 Slide.
CE1901 Week 6, Class 3 Week 6 Mini-Exam Review Muddiest Point Timing Diagrams (See this slide and Outcomes on course webpage – link now available)Outcomes.
CS2852 Week 6, Class 2 Today Class exercise: Implementing a recursive method Binary Search Trees Tomorrow: Quiz at start of lab Implementing a recursive.
Introduction to Computing Concepts Note Set 14. What if… You had to print “I love Java” to the screen 125 times. How? 125 lines of ▫ System.out.println(“I.
SE1011 Week 8, Class 2 Today Return Half Exam 3 (I have it with me) Object Oriented Programming Details Null references (as acting objects and arguments)
CS2910 Week 4, Class 1 Today Encoding in Python – Review Quiz – Encoding in Python Introduction to HTTP SE-2811 Slide design: Dr. Mark L. Hornick Content:
Week 9, Class 3: Java’s Happens-Before Memory Model (Slides used and skipped in class) SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
Today Quiz not yet graded Final report requirements posted More on Multithreading Happens-Before in Java SE-2811 Slide design: Dr. Mark L. Hornick Content:
CS2852 Week 3, Class 2 Today Big-O runtime analysis Linked Lists Muddiest Point Lab Quiz Includes writing a method from ArrayList class (See next slide)
SE1011 Week 8, Class 1 Today Return Half Exam 3 (I have it with me) Object Oriented Programming Details References as arguments Overloaded methods Garbage.
CE1901 Week 6, Class 3 Week 6 Mini-Exam Review Muddiest Point Timing Diagrams (See this slide and Outcomes on course webpage – link now available)Outcomes.
CS2852 Week 2, Class 2 Today Big-O runtime analysis Linked Lists Muddiest Point Lab Quiz Includes writing a method from ArrayList class (See next slide)
Week 7, Class 1: The Command Pattern (cont.) Get Ready for Poll Everywhere Labs 2 & 3 returned Lab 7 due this evening at 11pm Quiz tomorrow at start of.
CS2910 Week 4, Class 2 Today Sit by someone you have not yet worked with this quarter. Learn his/her name if unknown. Turn on your laptop and start Wireshark.
Week 3, Day 2: Patterns Review & New Pattern Return Quiz 1 (I have it with me) Russia Opportunity Muddiest Points – Patterns SE-2811 Slide design: Dr.
CS2910 Week 8, Class 2 Today Return Quiz Look at Schedule TCP implementation! Week 8, Monday Quiz on SMTP May include some questions requiring you to interpret.
Week 10, Day 3 Review for the quarter SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
CS2910 Week 7, Class 1 Today Capturing SMTP with Thunderbird Tomorrow Extra office hour at 11 am (right after lab) Friday Office hour cancelled SE-2811.
CS-2852 Data Structures Week 4, Class 1 - Review Review! Thursday Exam I - Review Implementing ArrayList Big-O Iterators – High-level description Linked.
SE1011 Week 7, Class 3 Today Return Half Exam 3 (I have it with me) Object Oriented Programming Details References as arguments Overloaded methods Garbage.
Chapter 9 Introduction to Arrays Fundamentals of Java.
Week 6, Class 3: Composite Swing composites File composites Computer composites SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
Week 8, Class 3: Model-View-Controller Final Project Worth 2 labs Cleanup of Ducks Reducing coupling Finishing FactoryMethod Cleanup of Singleton SE-2811.
CS2910 Week 6, Lab Today Dictionaries in Python SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
SE3910 Week 8, Class 2 Week 4 Lab: Please return your graded Lab 4 to me so I can enter it in my gradebook Week 7, Class 2 (Wednesday) Half-Exam 2 Done.
Slide design: Dr. Mark L. Hornick
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Week 2, Day 1: The Factory Method Pattern
Slide design: Dr. Mark L. Hornick
SE-1021 Software Engineering II
Week 7, Class 1: The Command Pattern (cont.)
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Week 8, Class 3: Model-View-Controller
SE-1021 Software Engineering II
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Slide design: Dr. Mark L. Hornick
SE-1021 Software Engineering II
Presentation transcript:

SE1011 Week 9, Class 3 Today Arrays with Loops! Homework SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 1

Muddiest Points Do static variables keep their values even when a different instance of the class is called?static crashes causes by order of checks with nulls involved short-circuit operators how to you create an array?arrays Can only a static method access a static variable?static Do we have to take the exam if we are happy with our half exam scores?exam Does anyone ever strictly use top-down or bottom-up design? Or does everyone always use a combination of the twodesign Is there a way to do what a static class variable does, without actually using the static class variable?static is it possible to design using only top-down or bottom-up?design What is an array and how do you use it?arrays everything was clear to me SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 2

More on arrays // Initialize an array int[] squares = {0, 1, 4, 9, 16, 25}; // Get the length of an array int howManySquares = squares.length; SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 3

Write what this code prints int[] cards = {1,2,3,4}; int i = 0; System.out.println("All the cards:"); while(i < cards.length) { System.out.println(i+": "+cards[i]); i++; } SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 4

Write what this code prints System.out.println("Again:"); i = 0; while(i < cards.length) System.out.println(i+": "+cards[i]); i++; System.out.println("Thanks for visiting!"); SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 5

Write what this code prints System.out.println("Again:"); i = 0; while(i < cards.length) i++; System.out.println(i+": "+cards[i]); System.out.println("Thanks for visiting!"); SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 6

Example Codingbat Problem zeroMax(…) zeroMax SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 7

Array Homework Array-1: Basic arrays. No Loops Array-1 makeEnds(…) makeEnds Array-2: One Loop Array-2 isEverywhere(…) isEverywhere withoutTen(…) withoutTen Array-3: Two or more loops, more complex logic Array-3 maxMirror (…) maxMirror Hint: To debug, return a number. 8

A codingbat Progress Graph maxSpan(…) maxSpan SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 9

An epic progress graph SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 10

SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 11

Acknowledgement This course is based on the text Introduction to Programming with Java by Dean & Dean, 2 nd Edition SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 12