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.

Slides:



Advertisements
Similar presentations
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
Advertisements

SE-1010 Dr. Mark L. Hornick 1 Defining Your Own Classes Part 3.
SE-1021 Software Engineering II Week 5, Class SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick 1.
UML Review – class diagrams SE 2030 Dr. Rob Hasker 1 Based on slides written by Dr. Mark L. Hornick Used with permission.
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:
SE-1021 Software Engineering II Week 8, Class 1 Return Exam Producing UML diagrams automatically in EA Poll Everywhere Files Tomorrow Week 6 HW due (if.
Dale Roberts Object Oriented Programming using Java - OOD to OOP: ATM Case Study Dale Roberts, Lecturer Computer Science, IUPUI
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:
CS-2852 Data Structures Week 5, Class 2 – Testing and Stacks Announcement: Lab Demos - 2/3 & 4 on Friday Testing  Definitions, Example  (tentative) Testing.
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.
CS2852 Week 3, Class 2 Today Stacks Queues SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
Chapter 5 Classes and Methods II Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E.
CS2910 Week 5, Class 2 Today DNS Muddy Points More HTTP Headers Review for Midterm Exam This coming Monday: Midterm Exam SE-2811 Slide design: Dr. Mark.
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.
Chapter 5 Classes and Methods II Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E.
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.
CS2910 Week 7, Lab Today SMTP lab Tuesday (Either today or yesterday) Extra office hour at 11 am (right after lab) Friday Office hour cancelled SE-2811.
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.
Week 3, Day 3: Singleton Pattern Quiz Status Russia Opportunity Muddiest Points – Patterns SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick.
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.
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 5, Day 3: Decorator Decorators Muddiest Point Tomorrow: Quiz on lab reading: web.msoe.edu/hasker/se2811/labs/5/ SE-2811 Slide design:
Week 5, Day 2: Decorator Decorators Muddiest Point Tomorrow: Quiz on lab reading: web.msoe.edu/hasker/se2811/labs/5/ SE-2811 Slide design:
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.
CPSC 233 Tutorial 5 February 9 th /10 th, Java Classes Each Java class contains a set of instance variables and methods Instance Variables: Type.
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.
Slide design: Dr. Mark L. Hornick
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.
CS2910 Week 5, Class 1 Today Sit by someone you have not yet worked with Turn on your laptop and start Wireshark. DNS Next week Monday: Midterm Exam SE-2811.
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.
SE1011 Week 9, Class 3 Today Arrays with Loops! Homework SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 1.
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.
UML Review Sequence Diagrams SE-2030 Dr. Rob Hasker 1 Based on slides written by Dr. Mark L. Hornick Used with permission.
UML Review – class diagrams SE-2030 Dr. Mark L. Hornick 1.
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Defining Your Own Classes Part 1
Slide design: Dr. Mark L. Hornick
SE-1021 Software Engineering II
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
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-1021 Software Engineering II
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
Presentation transcript:

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 SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 1

Old Muddy Points I'm a bit confused about the order in which methods are used.calling methods How to print the variables from another classreturning values when to use "this.xxx"this When would we want unnecessary decimal points? (# instead of 0)DecimalFormat I getting confused between objects and addresses and the actual clock codememory & code I would like to know if there are any syntax choice preferences you have that you would like us to use.syntax How to call an output from a class?returning values? 2 Key: bold – discussed this class; italics – discussed at start; underline – discussed in lecture

Muddiest Point (1) what is "static"?static - later I like that UML states clearly the methods and variables we are using. I only got confused in the last 10 mins of classmemory diagrams how to know when to make it public or private and also how to know if it is void or otherwise. public/private, returning values In the UML diagram, for methods when the return is not void, do we specify the type that is returned or the variable that is returned?UML: returning values Is UML basically a universal pseudocode? UML. Yes, but there are many forms bigger value than long? Yes - See BigInteger and BigDecimal 3 Key: bold – discussed this class; italics – discussed at start; underline – discussed in lecture

Muddiest Point (2) how to print variables from other classesreturning values How do you know when to use a private method? Should you just know or do you come back and find out later?public/private scope of variables between classespublic/private Would two references to the same object ever be useful in main?No - not yet Some of the PPT layout slides where the variables and methods are laid out are confusing. The actual java code makes more sense to mememory diagrams timing? 4 Key: bold – discussed this class; italics – discussed at start; underline – discussed in lecture

Scope A variable's scope is where it is visible This is determined by local / instance (local only visible in method) life of variable (local only "lives" to end of block) public / private (instance only visible in class unless public) SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 5

How to add culture to incubator? SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 6 Incubator ref incubator main(…) cupsCulture double Point A Incubator numBacteria long 0 In YogurtDriver 's main(…) Incubator incubator = new Incubator(); // Point A incubator.addStarterCups((double)1/8);

How to add culture to incubator? SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 7 Incubator ref incubator main(…) cupsCulture double addStarterCups(…) Point B Incubator numBacteria long 0 in Incubator 's addStarterCups(…) // Point B long newBacteria = (long)(starterCups * BACTERIA_PER_CUP_STARTER); Incubator ref this starterCups double

How to add culture to incubator? SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 8 Incubator ref incubator main(…) cupsCulture double addStarterCups(…) Point C Incubator ref this Incubator numBacteria long 0 in Incubator 's addStarterCups(…) long newBacteria = (long)(starterCups * BACTERIA_PER_CUP_STARTER); // Point C numBacteria += newBacteria; starterCups double 2_500_000_000 newBacteria long

How to add culture to incubator? SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 9 Incubator ref incubator main(…) cupsCulture double addStarterCups(…) Point D Incubator 2_500_000_000 numBacteria long in Incubator 's addStarterCups(…) numBacteria += newBacteria; // Point D Incubator ref this starterCups double 2_500_000_000 newBacteria long

How to print a class variable? SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 10 Incubator ref incubator main(…) cupsCulture double Point E Incubator 2_500_000_000 numBacteria long In YogurtDriver 's main(…) incubator.addStarterCups((double)1/8); // Point E

How to print a class variable? SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder 11 Incubator ref incubator main(…) cupsCulture double getNumBacteria(…) Point F Incubator 2_500_000_000 numBacteria long Complete this part. Also, what value is returned? SE1011 Week 6, Class 2 in Incubator 's getNumBacteria() // Point F return numBacteria;

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

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 13