3 Pages

09-23 Class Notes CS 107

Course: COP 2273, Fall 2011
School: UCF
Rating:
 
 
 
 
 

Word Count: 461

Document Preview

Class 09-23 Notes CS 107 Friday, September 23, 2011 2:47 PM Announcements: See updated description posted for program #3 Questions? Last Time: Program swap.java used to swap the value of two variables Today: Parameter scope, overloading, classes intuition Quiz: A for True, B for False T/F 1. You have to "catch" the same number of parameters that you "throw" T/F 2. The types...

Register Now

Unformatted Document Excerpt

Coursehero >> Florida >> UCF >> COP 2273

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Class 09-23 Notes CS 107 Friday, September 23, 2011 2:47 PM Announcements: See updated description posted for program #3 Questions? Last Time: Program swap.java used to swap the value of two variables Today: Parameter scope, overloading, classes intuition Quiz: A for True, B for False T/F 1. You have to "catch" the same number of parameters that you "throw" T/F 2. The types of parameters must be exactly the same T/F 3. To share one variable and any changes to it between two methods, you could pass it as a parameter and return any new value using the method return type. 4. To share two variables and any changes to them between two methods, you could pass them as a parameters and return any new values using the method return type. 5. To share multiple variables among methods in a class they must be declared at the top of the class, outside of any methods, but still inside the class. T/F T/F int x = 3; x,y = addOne( x); x = addTwo( x); int addOne( int y) { return y+1; } CS 107 Fall 2011 Page 1 { return y+1; } int addTwo( int z) { return z+2; } Scope Think of the scope of methods, which is an issue when parameters in different parts of your program have the same name. "You can look out of a box, but not into a box" [See other document under today's notes for Confuse.java] Overloading How similar can two methods Can be? they have the same name? [See the program getNext.java developed in class] Methods are useful because of: a. Code reuse: write once, reuse many times b. Problem decomposition: allows us to write code one section at a time Classes and Objects Introduction: What are classes and objects? A class is an abstract category of things. It is a blueprint or prototype that defines the values (variables) and the actions (methods) common to all objects of a certain kind. An object is a particular instance of a class. Software objects are often used to model real-world objects you find in everyday life. For example: CS 107 Fall 2011 Page 2 For example: Object, or Instance Cars The Reed family Chrysler Minivan Songs The Star Spangled-Banner Student Ima Hogg Circle Blue circle in upper-left corner of screen MemorableDate The time my car broke down Pasted from <https://sites.google.com/site/learnjav/java/objects-and-classes> Class Motivation: Think of existing types, like: int x = 3; We have the type as well as actions that can be performed on it (+,-,*,/, output) Now we want to make our own types, along with their own actions. Group together data and actions on that data, to make it easier to reuse code. Let's discuss the concepts involved as we develop the Date example which is presented in our text, in Chapter 4. CS 107 Fall 2011 Page 3
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

UCF - COP - 2273
09-23 Scope example, CS 107Monday, September 19, 2011 2:08 PMCS 107 Fall 2011 Page 1CS 107 Fall 2011 Page 2
UCF - COP - 2273
10-03 Class Notes CS 107Monday, October 03, 2011 12:12 PMAnnouncements: Solution to in-class and in-lab midterm1 were posted Thursday. Grades to the in-class portion were emailed around earlier this afternoon. Program #2 has been graded, with comments p
UCF - COP - 2273
10-05 Class Notes CS 107Wednesday, October 05, 2011 1:08 PMAnnouncements: See a partial solution to the Tic-Tac-More problem. In particular pay attention to the implementation of the board and how this affects the adjacency checking. Think of how using
UCF - COP - 2273
10-07 Class Notes CS 107Friday, October 07, 2011 3:08 PMAnnouncements: Questions? Last Time &amp; Today: From last time see the date classes developed in lecture and posted online. Problems and [solutions], not necessarily in the following order. a. [Done]
UCF - COP - 2273
10-10 Class Notes CS 107Monday, October 10, 2011 3:58 PMAnnouncements: Program 4 has been posted, and is due in two weeks from yesterday. Take a look!Questions?Last Time: Objects and classes. Today: More on Objects and Classes (continued from last tim
UCF - COP - 2273
10-12 Class Notes CS 107Wednesday, October 12, 2011 2:26 PMAnnouncements: I added a link online under the Lab,TA,Tutoring page for the MERRP Supplemental Instruction (SI) resource. MERRP is on the 12th floor of SEO. I have to leave immediately after cla
UCF - COP - 2273
10-14 Class Notes CS 107Friday, October 14, 2011 4:06 PMAnnouncements: Questions?Last Time: Example of Objects &amp; Classes: EmployeeToday:Sample midterm #2 exam: When you create a class (so that the &quot;driver&quot; code works), you will likely need: 1. Instan
UCF - COP - 2273
10-17 Class Notes CS 107Monday, October 17, 2011 2:44 PMAnnouncements: 1. Make sure to sign up for advising this week. 2. Program #4 (WordLine): Remember that if input is invalid for any reason, you disable a line of characters and also deduct a point f
UCF - COP - 2273
10-19 Class Notes CS 107Wednesday, October 19, 2011 2:21 PMAnnouncements: Next week we have Midterm #2 in class Wed. and during lab Program #4 due this Sunday Questions? Last Time: Examples of arrays: counting charactersToday: Comments on Program #4: 1
UCF - COP - 2273
10-21 Class Notes CS 107Friday, October 21, 2011 1:39 PMAnnouncements: Next week we have Midterm #2 in class Wed. and during lab Program #4 due this Sunday Arrays Codelab problems extended until Sat. 10/22 at 11:59pm Questions? Last Time: Comments on pr
UCF - COP - 2273
10-24 Class Notes CS 107Monday, October 24, 2011 2:08 PMAnnouncements: 1. Midterm #2 in class Wed. and during your regular lab Tues/Wed this week. 2. The exam will only cover material up through what we discuss today in class, so most of the recursion p
UCF - COP - 2273
10-28 Class Notes CS 107Friday, October 28, 2011 4:00 PMAnnouncements: Program #5 should be out this weekend Grades have been posted online. Drop deadline is TODAY. Questions?Last Time: Midterm Exam Time before that: Arrays: Selection Sort Today: Array
UCF - COP - 2273
10-31 Class Notes CS 107Monday, October 31, 2011 2:31 PMAnnouncements: 1. Office Hours Wed shifted to 1:30. No office hours Fri. 2. Class Friday will be a video lecture. See the class notes entry on Friday before class for details. 3. Program #5 has bee
UCF - COP - 2273
11-02 Class Notes CS 107Tuesday, November 01, 2011 11:02 AMAnnouncements: No office hours Friday (11/4). Class on Friday will combine some online notes with part of an online video lecture. See the Friday notes (already posted) for this.Questions?Last
UCF - COP - 2273
11-4 Class Notes CS 107Tuesday, November 01, 2011 11:03 AMAnnouncements: No office hours today. Class is a video lecture, with the addition of resources listed below.Last Time: Recursion examples, 2 ways to do a trace of recursive code Today: Topic: Ar
UCF - COP - 2273
11-07 Class Notes CS 107Monday, November 07, 2011 2:09 PMAnnouncements: - See the online updates to program #5: partial credit for grading is given, along with suggestions on how to approach this problem one piece at a time. - Lab this week will again b
UCF - COP - 2273
11-09 Class Notes CS 107Wednesday, November 09, 2011 2:54 PMAnnouncements: In-class portion of midterm has been graded and emailed to you. See the updated overall grades online. Deadline for program #5 has been extended Anyone find an RCA mp3 player aft
UCF - COP - 2273
11-09 Maze ProblemMonday, November 07, 2011 12:47 PMCS 107 Fall 2011 Page 1CS 107 Fall 2011 Page 2CS 107 Fall 2011 Page 3CS 107 Fall 2011 Page 4CS 107 Fall 2011 Page 5
UCF - COP - 2273
11-11 Class Notes CS 107Friday, November 11, 2011 3:39 PMAnnouncements: For testing program #5 use 4 big words that overlap. Marisol after last class suggested: 5 Materialization Misdistribution Daydreaming Unconditional Yellow To play with the maze cod
UCF - COP - 2273
11-14 Class Notes CS 107Monday, November 14, 2011 2:12 PMAnnouncements: For lab this week you will be asked to modify the maze program, changing values in the maze as you go instead of using the cameFrom array. Program #5 is due ThursdayQuestions? .som
UCF - COP - 2273
11-16 Class Notes CS 107Wednesday, November 16, 2011 2:37 PMAnnouncements: Program #5 due tomorrow night at 11:59pm.Questions?Last Time: Recursion examplesToday: Comment on program Palindrome checker using recursion (developed in class) Linked list i
UCF - COP - 2273
11-18 Class Notes CS 107Friday, November 18, 2011 3:17 PMAnnouncements: Program #6 has been posted and is due Wed 11/30, which is slightly less than 2 weeks. Questions?Last Time: Palindrome checker iteratively and recursively; Intuition for Linked List
UCF - COP - 2273
11-21 Class Notes CS 107Monday, November 21, 2011 10:37 AMAnnouncements: Class Wednesday will be a video lecture on recursively reversing a linked list. This example is an opportunity to combine everything we've learned so far this semester: variables,
UCF - COP - 2273
11-23 Class Notes CS 107Tuesday, November 22, 2011 9:10 PMAnnouncements: Today's class is a video lecture, with the links to the different sections shown below. The additional documents listed under the 11-22 date are the notes that accompany the videos
UCF - COP - 2273
11-28 Class Notes CS 107Monday, November 28, 2011 2:17 PMAnnouncements: In-lab final exam during your regularly scheduled lab on Tues &amp; Wed. Be prepared to use an array (1D or 2D) to handle a table of numbers. Program #6 is due Wednesday at 11:59pm, jus
UCF - COP - 2273
11-30 Class Notes CS 107Wednesday, November 30, 2011 12:13 PMAnnouncements: Program #6 is due tonight at 11:59pm, just before midnight. The in-class final exam time &amp; place is posted at the bottom of the class schedule: 3:30-5:30 Tuesday 12/6, LC D5 Sol
UCF - COP - 2273
12-2 Class Notes CS 107Wednesday, November 30, 2011 12:22 PMAnnouncements: Today is the last class (Boo-Hoo and Yay) A solution to program #6 has been posted. The various issues have been corrected on it. An updated grade sheet with an updated curve wil
UCF - MATH - 2112
What shape is a circle?Complex Systems Summer School,Santa Fe InstituteTom Carterhttp:/astarte.csustan.edu/~ tom/SFI-CSSS June 24, 20061How do we define a circle?We usually define a circle as C = cfw_x | |x| = 1 (i.e., the set of all vectors x of l
UCF - MATH - 2112
Clustering in Networks(Spectral Clustering with the Graph Laplacian . . . a brief introduction)Tom Carter Computer Science CSU Stanislaus http:/csustan.csustan.edu/~ tom/Clustering March 2, 20111Our general topics:What is Clustering? 3An Example8S
UCF - MATH - 2112
Introduction to theory of computationTom Carterhttp:/astarte.csustan.edu/~ tom/SFI-CSSSComplex Systems Summer SchoolJune, 20051Our general topics: Symbols, strings and languages Finite automata Regular expressions and languages Markov models Contex
UCF - MATH - 2112
A very brief introduction to differentiable manifoldsTom Carterhttp:/cogs.csustan.edu/~ tom/diff-manifoldsSanta Fe Institute Complex Systems Summer SchoolJune, 20011Our general topics: Why differentiable manifolds Topological spaces (ex) Examples o
UCF - MATH - 2112
A very brief introduction to differentiable manifoldsTom Carterhttp:/cogs.csustan.edu/~ tom/diff-manifoldsSanta Fe Institute Complex Systems Summer SchoolJune, 20011Our general topics:Why differentiable manifolds 3Topological spaces4Examples of
UCF - MATH - 2112
Entropy, Power Laws, and EconomicsTom CarterComplex Systems Summer School SFI, 2007http:/astarte.csustan.edu/~ tom/Santa Fe June, 20071ContentsMathematics of Information Some entropy theory A Maximum Entropy Principle Application: Economics I Fit t
UCF - MATH - 2112
Econ 102(Random walksand high nance)Tom Carterhttp:/astarte.csustan.edu/ tom/SFI-CSSSFall, 20081Our general topics: Financial ModelingSome random (variable) backgroundWhat is a random walk?Some Intuitive Derivations2Financial Modeling Lets u
UCF - MATH - 2112
The Logistic Flow(continuous)Tom CarterComplex Systems Summer SchoolJune, 20091Discrete logistic mapWe all know that the discrete logistic map Pn+1 = rPn (1 - Pn ) exhibits interesting behavior of various sorts for various values of the parameter r
UCF - MATH - 2112
Some Fractals and Fractal Dimensions The Cantor set: we take a line segment,and remove the middle third. For each remaining piece, we again remove the middle third, and continue indefinitely. To calculate the fractal / Hausdorff /capacity / box-counti
UCF - MATH - 2112
Some Fractals and Fractal DimensionsThe Cantor set:we take a line segment, and remove the middle third. For each remaining piece, we again remove the middle third, and continue indefinitely.To calculate the fractal / Hausdorff /capacity / box-counting
UCF - MATH - 2112
UCF - MATH - 2112
planetepicyclecycleretrograde
UCF - MATH - 2112
An introduction to information theory and entropyTom Carterhttp:/astarte.csustan.edu/~ tom/SFI-CSSS Complex Systems Summer School Santa FeJune, 20071ContentsMeasuring complexity Some probability ideas Basics of information theory Some entropy theory
UCF - MATH - 2112
UCF - MATH - 2112
What is Interdisciplinary?Discipline (and punish? :-)Physics ChemistryBiologyMathematicsEconomicsPsychologyEtc.Or . . .Physics Chemistry Biology Social SciencesEtc. qOr . . .MathematicsReal WorldBut is this really . . .MathematicsReal Worl
UCF - MATH - 2112
Some Fractals and Fractal Dimensions The Cantor set:we take a line segment, and remove the middle third. For each remaining piece, we again remove the middle third, and continue indefinitely. To calculate the fractal / Hausdorff /capacity / box-counti
UCF - MATH - 2112
A brief survey of linear algebraTom Carterhttp:/astarte.csustan.edu/~ tom/linear-algebraSanta Fe Institute Complex Systems Summer SchoolJune, 20011Our general topics: Why linear algebra Vector spaces (ex) Examples of vector spaces (ex) Subspaces (e
UCF - MATH - 2112
The Logistic Flow(Continuous)Tom Carterhttp:/astarte.csustan.edu/ tom/SFI-CSSSComplex Systems Summer SchoolJune, 20081Logistic ow . . .We all know that the discrete logistic mapPn+1 = rPn(1 Pn)exhibits interesting behavior of various sortsfor v
UCF - MATH - 2112
Making SenseTom Carterhttp:/astarte.csustan.edu/~ tom/SFI-CSSSApril 2, 20091Making SenseIntroduction / theme / structure 3Language and meaning Language and meaning (ex) . . . . . . . . . . . . . . .6 7Theories, models and simulation Theories, mod
UCF - MATH - 2112
Nonlinear Systems(. . . and chaos) a brief introductionTom Carter Computer Science CSU Stanislaus http:/csustan.csustan.edu/~ tom/Lecture-Notes/Nonlinear-Systems/Nonlinear-Systems.pdf November 7, 20111Our general topics:What are nonlinear systems? A
UCF - MATH - 2112
PerspectiveComplex Systems Summer School June, 2006
UCF - MATH - 2112
A Little Probability. . Coding and Information Theory Fall, 2004Tom Carter http:/astarte.csustan.edu/~ tom/ October, 20041Some probability background There are two notions of the probability of an event happening. The two general notions are: 1. A fr
UCF - MATH - 2112
A brief overview of quantum computingor, Can we compute faster in a multiverse?Tom Carterhttp:/cogs.csustan.edu/~ tom/quantum. . .. June, 20011Our general topics: Hilbert space and quantum mechanics Tensor products Quantum bits (qubits) Entangled
UCF - MATH - 5485
AIMS Exercise Set # 1Peter J. Olver1. Determine the form of the single precision floating point arithmetic used in the computers at AIMS. What is the largest number that can be accurately represented? What is the smallest positive number n1 ? The second
UCF - MATH - 5485
AIMS Exercise Set # 2Peter J. Olver1. Explain why the equation e- x = x has a solution on the interval [ 0, 1 ]. Use bisection to find the root to 4 decimal places. Can you prove that there are no other roots? 2. Find 6 3 to 5 decimal places by setting
UCF - MATH - 5485
AIMS Exercise Set # 3Peter J. Olver1. Which of the following matrices are regular? If reguolar, write down its L U 1 -2 3 2 1 0 -1 factorization. (a) , (b) , (c) -2 4 -1 . 1 4 3 -2 3 -1 2 2. In each of the following problems, find the A = L U factorizat
UCF - MATH - 5485
AIMS Exercise Set # 4Peter J. Olver1. Find the explicit formula for the solution to the following linear iterative system: u(k+1) = u(k) - 2 v (k) , v (k+1) = - 2 u(k) + v (k) , u(0) = 1, v (0) = 0.2. Determine whether or not the following matrices are
UCF - MATH - 5485
AIMS Exercise Set # 5Peter J. Olver1. Use the power method to find the dominant eigenvalue and associated 4 1 0 1 -2 0 1 1 4 1 0 eigenvector of the following matrices: (a) -3 -2 0 , (b) . 0 1 4 1 -2 5 4 1 0 1 4 2. Use Newton's Method to find all points
UCF - MATH - 5485
AIMS Exercise Set # 6Peter J. Olver1. Prove that the Midpoint Method (10.58) is a second order method. 2. Consider the initial value problem du = u(1 - u), dt for the logistic differential equation. solution for t &gt; 0. (b) Use the Euler Method with step
UCF - MATH - 5485
AIMS Exercise Set # 7Peter J. Olver1. In this exercise, you are asked to find &quot;one-sided&quot; finite difference formulas for derivatives. These are useful for approximating derivatives of functions at or near the boundary of their domain. (a) Construct a se
UCF - MATH - 5485
AIMS Lecture Notes 2006Peter J. Olver6. Eigenvalues and Singular ValuesIn this section, we collect together the basic facts about eigenvalues and eigenvectors. From a geometrical viewpoint, the eigenvectors indicate the directions of pure stretch and t
UCF - MATH - 5485
Chapter 16 Complex AnalysisThe term &quot;complex analysis&quot; refers to the calculus of complex-valued functions f (z) depending on a single complex variable z. On the surface, it may seem that this subject should merely be a simple reworking of standard real v
UCF - MATH - 5485
AIMS Lecture Notes 2006Peter J. Olver1. Computer ArithmeticThe purpose of computing is insight, not numbers. - R.W. Hamming, [23]The main goal of numerical analysis is to develop efficient algorithms for computing precise numerical values of mathemati
UCF - MATH - 5485
Chapter 21 The Calculus of VariationsWe have already had ample opportunity to exploit Nature's propensity to minimize. Minimization principles form one of the most wide-ranging means of formulating mathematical models governing the equilibrium configurat