# Register now to access 7 million high quality study materials (What's Course Hero?) Course Hero is the premier provider of high quality online educational resources. With millions of study documents, online tutors, digital flashcards and free courseware, Course Hero is helping students learn more efficiently and effectively. Whether you're interested in exploring new subjects or mastering key topics for your next exam, Course Hero has the tools you need to achieve your goals.

3 Pages

### August242006

Course: EECS 1560, Fall 2008
School: Toledo
Rating:

Word Count: 1063

#### Document Preview

a Designing Program Problem Specification and Decomposition. Determine the object's (things) that a program needs to work with (normally nouns in a problem specification) and the things it needs to do (normally verbs) by looking at the specification. Design a class that will represent a simple geometric rectangle with a given length and width. The definition of this class should make it possible to create...

Register Now

#### Unformatted Document Excerpt

Coursehero >> Ohio >> Toledo >> EECS 1560

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.
a Designing Program Problem Specification and Decomposition. Determine the object's (things) that a program needs to work with (normally nouns in a problem specification) and the things it needs to do (normally verbs) by looking at the specification. Design a class that will represent a simple geometric rectangle with a given length and width. The definition of this class should make it possible to create rectangles of various dimensions and calculate their areas. Java First Programs August 24, 2006 Object Design What is the object's role in the program? What data or information does it need to keep track of? What actions will it take or will be requested of it? Data, Methods, and Algorithms Values we store inside an object are normally referred to as instance variables and reflect the data that needs to be stored. Actions that the object is asked to perform become methods. The set of steps that the object will do when a method is called or invoked are an algorithm. Some Simple Principles Before We Start Programs should be easy to read and understand. Comments should be used to document and/or explain the program's code. Programs should be clear and should avoid tricks and unnecessarily obscure or convoluted code. Programs should be designed and written so that they are easy to maintain and change. A Simple Program /** * @author Jerry Heuring * * A first example using Java it only prints a * message but it is a start. */ public class Example1 extends Object { public void printMessage() { System.out.println("It's Alive!!!"); } public static void main (String arguments[]) { Example1 ourObject; ourObject = new Example1(); ourObject.print(); System.exit(0); } } 1 The Pieces /** * @author Jerry Heuring * * A first example using Java only prints a * message but it is a start. */ Defining the Class This is the portion that declares a class. public class Example1 extends Object { Example1 is the name of our class. "extends Object" says it inherits from the object class in Java. If you don't say this it still inherits from the Object class. This is a javadoc comment (starts with a /** and ends with an */). It identifies the author and the program's purpose. It's not required to run but we want it there for documentation purposes. The computer ignores comments but I don't. "public class" says that this is a class that everybody (the public) can see. } Adding a Method public void printMessage( ) { System.out.println("It's Alive!!!"); } This is a method. public says anybody can use it. void says it doesn't return anything. This tells the type of the result (if any) that the method returns. printMessage is the name of the method ( ) lists the items that the method needs to have passed to it. In this case, since the parenthesis are empty, nothing is passed. System.out.println( ) is a call to a method. The method belongs to the System.out object which is predefined. "It's Alive!!!" is a string constant (it can't be changed without rebuilding the program) and is passed to the println method. Adding a Second Method public static void main (String arguments[]) { Example1 ourObject; ourObject = new Example1(); ourObject.print(); System.exit(0); } This is an important routine. Java Applications start with the "main" routine. Without a main routine we couldn't run our application as Java wouldn't know where to start. It again returns nothing is and visible to everybody (public and void) The static says there is only one copy of this routine no matter how many Example1 objects we make. More on this later. The "String arguments[]" in the parenthesis says that the main program expects an array (or list) of Strings to be passed in. We will ignore this for right now. The Internal Items Example1 ourObject; ourObject = new Example1(); ourObject.print(); System.exit(0); Running the Program When we compile and run the program it prints out the line: It's Alive!!! The statements in the method do a number of things: Example1 ourObject; creates a variable, ourObject, which will hold a reference to an object of the type Example1. ourObject = new Example1(); creates or instantiates a new object using the Example1 class as a blueprint. The reference to this object is then stored in ourObject. ourObject.print(); calls the print method belonging to the object we just created. System.exit(0); calls a method to exit the program. 2 Classes Notice everything is inside of a class right now. Everything in Java must be contained in classes. Each class is usually placed in a separate file. The filename must match the class name. Constructors Constructors are used to initialize an object into a (hopefully) known state. They may do some computation There may be more than one constructor as long as the number or types of the arguments to the constructor are different. They all have the same name as the class. When Is the Constructor Called? A common question is when is a constructor actually called? When an object is instantiated (big word may want to think of it as created). Simple Demonstration Program /** * @author Jerry Heuring * Created May 27, 2004 * * @version 1.0 * * Bugs * * Revisions * * This class is a simple demonstration to demonstrate when a * constructor is called. It also tries to demonstrate the * need for instantiating (creating) an object in the main * program. */ public class ConstructorDemo { When is an object instantiated? Usually with a "new objectT...

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:

Toledo - EECS - 1560
Project 1 EECS 1560: Intro to Object-Oriented Programming Hurricane in an Object Due: Monday September 12, 2005DescriptionIn this project you will build a container class to hold information about a hurricane. The class will need to hold the follow
Toledo - EECS - 1560
Parameters Methods &amp; Simple Control Structures So far our methods (or member functions) have done very little we really don't know how to make them do much (yet.) One thing we would lie to do is to pass information into and out of a method.Passi
Toledo - EECS - 1560
Laboratory 2 EECS 1560: Intro to Object Oriented Programming Fall 2005Building a ClassIn this lab you will build a simple class that allows us to manipulate a simple object. Start by creating a project in your Eclipse workspace name it Lab2. Now,
Toledo - EECS - 1560
Test 1 Test 1, Clarifications, and more Control StructuresOctober 4, 2004 Two versions results are equivalent and questions are only slightly different Had 90 points on it so scores are reported out of 90 (not 100). Statistics High Median Av
Toledo - EECS - 1560
Announcements Reminder Project 5 is due Wednesday December 1st Handout Project 6 Due Friday December 10th by 5 PM. The e-mail must be sent to me by this time. The print outs can be turned in under my door or directly to me. The time on the e-m
Toledo - EECS - 1560
Project 5 Intro To Object Oriented ProgrammingNovember 28, 2005 Due on Wednesday, November 30th, 2005. Need a printed listing and an e-mailed version.Test 2 Nothing major to report other than 10 points will be added to the scores across the boa
Toledo - EECS - 1560
Coverage Test Material Chapters 0-3 Chapter 4 Sections 4.5 Chapter 5 Sections 5.1-5.6Quick Self Test Write a class with 3 instance variables: a state, a city, and a zip code. Your class should have a constructor that will initialize the 3 ins
Toledo - EECS - 1560
Tentative Timetable for EECS 1560Instructor: Jerry HeuringWeek 08/22/05 08/29/05 09/05/05 09/12/05 09/19/05 09/26/05 10/03/05 10/10/05 10/17/05 10/24/05 10/31/05 11/07/05 11/14/05 11/21/05 11/28/05 12/05/05 12/14/05 Topic(s) Introduction &amp; Object O
Toledo - EECS - 1560
Lab Collections Week of October 31, 2005 EECS 1560: Intro to Object Oriented Programming Description:In this lab you will work with a couple of collections you may want to consider this an extension on last weeks lab. We will use a class that hold
Toledo - EECS - 1560
Lab 8 Intro To Object Oriented Programming Week of October 24th, 2005 Arrays and Objects BackgroundIn this lab you will complete a class that works with an array of objects. The objects in this case are winners of the Tour de France. Each winner ha
Toledo - EECS - 1560
Final Intro to Object Oriented ProgrammingNovember 30, 2005 The final examination for Sections 1, 2, and 3 (the non-honors sections) is Thursday, December 15, 2005 from 12:302:30 in this room (NI 1027) It will be comprehensive It will be longer t
Toledo - EECS - 1560
This is a change The test should be Wednesday not Thursday as was announced in class.Test ReminderIntro to Object Oriented ProgrammingDecember 5, 2005 Final Wednesday 12:30-2:30 Final Tuesday 2:45-4:45 (Honors Section) 1 Sheet (8 &quot; b
Toledo - EECS - 1560
Laboratory 2 Debugging Features EECS 1560: Introduction to Object Oriented Programming BackgroundMost development environments have support for a debugger with certain features. Program developers use a debugger to help find and correct errors (als
Toledo - EECS - 1560
Test Wednesday November 10, 2004Graphical User InterfacesNovember 1, 2004 Covers Through Arrays (Does not include collections) Chapters 0-8 Emphasis on new material Chapters 5-8 Strings Should know basics assignment concatenation (+) .eq
Toledo - EECS - 1560
DandelionWeedus Outusannualpartial sun30.01
Toledo - EECS - 1560
Project 6 EECS 1560 A Graphical User Interface for Plants Due: December 11, 2006Description:In this project you will be given a text based program that works to hold information on plants. Your program will need to provide a graphical user interfa
Toledo - EECS - 1560
Project 3 EECS 1560: Intro to Object Oriented Programming Due: Start of Class on Tuesday October 24, 2006 Film AppletDescription:In this project you will create a group of classes that represent a movie and allow the user of your program to enter
Toledo - EECS - 1560
Project 5 - EECS 1560 A Class for Contact Information Due: December 5, 2006Description:In this project you are to implement a class that holds contact information on individuals. The contact information for an individual includes their name, their
Toledo - EECS - 1560
Project 4 EECS 1560 Memory: A Simple Game using Arrays Due: November 16, 2006 Description:In this project you are to use an array to hold a group of cards. The cards are going to be used for the game &quot;memory&quot;. The project can be done as a text base
Toledo - EECS - 4530
Reminder Test Wednesday!Input and GLUINovember 13, 2006Open Books and Notes Covers new material including textures, ray tracing, curves, hidden surfaces, discrete methods. Probably little code required. 5-6 questionsCurrent ProjectDelayed to
Toledo - EECS - 4530
Display Lists and TransformationsSeptember 16, 2002nWhat is a Display List?w Something like a subroutine.Rather than repeatedly put in primitives for an object it will allow you to reuse them. Cannot pass parameters to a display list Two steps,
Toledo - EECS - 4530
Basics Monday December 13, 2004Computer GraphicsDecember 5, 20045:00-7:00 PM Open Book and Notes Lots of (hopefully shorter) questions. ComprehensiveGreen Book Chapters 1, 2, 4, 5, 6, 7, 8, 9, 11, 14 Chapter 3.1-3.4, 3.14, 3.16-3.17, 3.23-3
Toledo - EECS - 4530
Characteristics Input and GLUTs CallbacksEECS 4530: Computer Graphics I September 9, 2002nn n nAll the GLUT supported I/O routines use callbacks to return information to the program. This type of input would be known as event mode input. Reques
Toledo - EECS - 4530
This Example More Primitives &amp; AttributesSeptember 1, 2004 We will try to do a fair amount with a very simple basic object a box. The width, depth, height, and position of the box can be specified. We will also look at how to &quot;move around&quot; the b
Toledo - EECS - 4530
Laboratory 1 Computer Graphics I Getting Started with GLUT and OpenGLFall 2006 Purpose of Lab: The purpose of this lab is to get you to a point where you can compile and run OpenGL programs on the University systems The instructions are for the Sun
Toledo - EECS - 4530
Problem 1 Textures in OpenGL are attached to a surface using texture coordinates. Given the following texture give the texture coordinates to apply it to the polygon shoen to achieve the shading shown assuming we are using GL_REPLACE mode. Assuming
Toledo - EECS - 4530
Modeling Complex Objects It is necessary to link or group pieces together into an object at times. An example of this would be a human limb. You rotate your shoulder and the arm rotates as wellComputer GraphicsHierarchies of Objects September 19
Toledo - EECS - 4530
Orthographic ProjectionsComputer Graphics I September 12, 2005 Ignores the Z direction No perspective (distance makes no difference) Common in many types of Engineering drawing.How do we change the plane?Could change around the coordinates and dr
Toledo - EECS - 4530
Animation Techniques Flocking and Particle SystemsComputer GraphicsSeptember 28, 2005 We often need to have a group of objects but do not want to script or write the exact motion of the object. Originally occurred with the idea of flocking bird
Toledo - EECS - 4530
Syllabus EECS 4530: Computer GraphicsCatalog Description: 4 hours. Prerequisite: EECS 1500 or EECS 1530. An introduction to typical computer graphics systems and their operation. Supporting software will be generally discussed with examples given fr
Toledo - EECS - 4530
Note These slides were not actually used in class but do contain the information that we went over. I'm using them to summarize what we did go over.Computer GraphicsAugust 31, 2005Topics Compiling an application under Microsoft Windows using G
Toledo - EECS - 4530
To Run GLUT and OpenGL Using Borland1. Copy the glut32.dll and glut.h files down from the links page on the class website (http:/ /www.eecs.utoledo.edu/~jheuring/eecs4530.html) to the directory your project will be in. Open a Command or MS-DOS Windo
Toledo - EECS - 4530
Computer Graphics: Vector Operations &amp; Object RepresentationSeptember 20, 2004OpenGL Vertex Arrays Rather than calling glVertex for each vertex we can use a more powerful method.Steps1. Enable the vertex processingglEnableClientState(GL_VERTE
Toledo - EECS - 4530
Test Coverage Red Book Chapter 2 State Management and Drawing Geometric Objects Primitives, normals, vertex arraysComputer GraphicsOctober 10, 2005 Chapter 3 Viewing Projection Transforms Viewing and modeling transforms Matrix Stacks C
Toledo - EECS - 4530
Test 1 Results Computer Graphics High Low Median Average 97 50's 82 78Test 1 ResultsCurrent Project A routine and class for NFF files is available on the Web Site It reads the format as specified.100 90 80Series1S c o re70 60 50 0 5
Toledo - EECS - 4530
Test Info Computer GraphicsDecember 9, 2002Monday December 16 5-7PM Here (PL 3100) Open book and notes Comprehensive but will include Discrete Techniques (Ch. 7) Particle Systems (Ch. 11.3)Some more B-Spline InfoWhy are there knots? And why more
Toledo - EECS - 4530
Computer GraphicsMore on InputlWe mentioned 3 modes last time Sample Event RequestSeptember 11, 2002Types of InputlPicks and Locations in OpenGLl lGenerally broken into 6 types locatorl l l l l lbrings back a location or
Toledo - EECS - 4530
Getting Started With OpenGLPrimitivesOpenGL supports a number of primitives that include: Points (GL_POINTS) Lines (GL_LINES), Line Strips or Polylines (GL_LINE_STRIP), and Line Loops (GL_LINELOOP) Triangles (GL_TRIANGLES), Triangle Strips (G
Toledo - EECS - 4530
What is an Attribute Primitives and AttributesSeptember 4, 2002nAn attribute changes the appearance of a primitive.n n n n nColor Line type (dotted, dashed, etc.) Line width filled or unfilled (polygon) italic, bold, or plain (text)Changing
Toledo - EECS - 052005
cone 10.0 0.0 10.0 2.0 10.0cylinder -10.0 0.0 10.0 2.0 10.0sphere -10.0 0.0 -10.0 3.0sphere 10.0 0.0 -10.0 3.0cylinder 100.0 0.0 0.0 3.0 10.0cylinder -100.0 0.0 0.0 3.0 10.0cylinder 0.0 0.0 100.0 3.0 10.0cylinder 0.0 0.0 -100.0 3.0 10.0
Toledo - EECS - 2000
Ethics Report - PrivacyTopics: Spam Free Speech or Invasion of Privacy? Is Online Speech Protected as Free Speech? RFID's and Privacy Is it Much Ado About Nothing? Satellite Photos Is Somebody Watching? GuidelinesAgain, 3-5 pages double
Toledo - EECS - 2000
Company ReportAssigned CompaniesIntel General Electric Hewlett-Packard Sun Microsystems Keithley Instruments First Energy Corporation IBM EE/CE/CS EE/CE EE/CE/CS CE/CS EE/CE EE/CE/CS EE/CE/CSReport GuidelinesShould be about 3-5 pages double spac
Toledo - EECS - 1570
Take a Grammar and Generate StringsProject 5March 31, 2005 Depending on the underlying complexity of the grammar this could generate some very convincing text. (Of course parts may be pure garbage as well)Derivations Using the grammar on the
Toledo - EECS - 1570
Some Changes Sorted Lists Array BasedEECS 1570 Spring 2005 Adds and Deletes must be done differently than in our unsorted version Searches can be done more efficiently Most of the rest is unchanged.Add An add is going to take a couple of step
Toledo - EECS - 1570
Big O notation As mentioned earlier we rate algorithms and data structures on their running time. Normally depends on the number of items in the structure. Common Operations: Adding Searching DeletingOrder of OperationsEECS 1570: Linear Data
Toledo - EECS - 1570
Merge SortAlgorithmTo do the merge we will split it into 3 cases. Two easy cases:If the first list is empty you just need to copy the second list over to the new, sorted list. If the second list is empty you just need to copy the first list
Toledo - EECS - 4980
JavaApril 7, 2003Tip of The Day Dialog Boxes Often one wants to put up a dialog box that must be completed before continuing. JOptionPane class in Swing provides this functionality Different Types of Dialogs are SupportedA Quick Sampleimpor
Toledo - EECS - 1570
&lt;sound bite&gt;&lt;sound bite&gt; &lt;catch phrase&gt; &lt;vague platitude&gt; &quot; You're no &quot; &lt;impressive person&gt; &quot;!&quot;&lt;catch phrase&gt; &quot;Read my lips: &quot;&lt;catch phrase&gt; &quot;As &quot; &lt;impressive person&gt; &quot; always said: &quot;&lt;vague platitude&gt; &quot;no taxes! &quot;&lt;vague platitude&gt; &quot;nuke &quot; &lt;some
Toledo - EECS - 1570
Test GroupThis is a test group for the fourth project to checkif the read functions workTest Message 1IshmaelWed Mar 09 15:15:59 EST 2005Hey mjan, I just got a job on a ship out of Nantucket!Cool! Ishy Bill Wed Mar 09 16:15:43 EST 2005
Toledo - EECS - 1570
Toledo - EECS - 1570
Definitions Hash Function A function used to manipulate the key of an element in a list to identify its location in the list. This can be as simple as picking the first letter of a string, the last two digits of a year, or some such value. A good
Toledo - EECS - 1570
Project 3 Linear Data Structures Say Cheese! Due: March 3, 2005Description:In this project you are going to design and implement a program to guide the new RC4000 robotic mouse through a maze to find a hunk of virtual cheese. The mouse can move n
Toledo - EECS - 1570
EECS 1570: Linear Data Structures - Project 1 : Automated Menu Due: Thursday January 27, 2005Background This project is meant for you to brush up your programming skills and possibly use some of the Java programming techniques that are discussing in
Toledo - EECS - 1570
Links Lab Linear Data StructuresGoalIn todays lab we will try construct a set of routines for a stack and a queue using linked structures.Procedure:Two completed classes and two skeletons are available for download from the class website at htt
Toledo - EECS - 1570
Course Timetable EECS 1570: Linear Data StructuresThis timetable is only a guess as to the timing and ordering of topics and may change during the term. As projects are distributed in class and prior to the midterm we will verify the dates in class.
Toledo - EECS - 1570
Automated Text Generator Project 5 Linear Data Structures Due: April 19, 2005DescriptionIn this project you will write a program that will input a grammar that describes a system of productions (a grammar) that will generate a story, a joke, or an
Toledo - EECS - 1570
Project1 Graded out of 125 points Most common problem menu only printed at start of program. Other problems: Items on menu. We specified 200 in class with possibly 10 choices or 5 sizes. Read the file but don't use it Missing pieces (like orde
Toledo - EECS - 1570
Thursday's ClassTest 1 Example Questions &amp; ReviewLinear Data Structures Spring 2005 We will meet in the Sun lab (NE 1026) on Thursday from 2:00-3:15. The lab will go through linked structures for stacks and queues. If you need to attend the Job
Toledo - EECS - 1570
Test 1 Answers ResultsHigh Average Median 94 78 81Spring 2005 Linear Data StructuresProject 2 StatsQuestion 1public double occupancy( ) { int i, occupied; occupied = 0; for (i = 0; i &lt; values.length; i+) { if (values[i] != null) { occup
Toledo - EECS - 1570
Reading Information in Java Software EngineeringEECS 1570 Spring 2005 In Java, assume we want to read from the console. You should probably create a BufferedReader to allow you to read lines. In Java, the Buffered Reader reads lines well but doesn't
Toledo - EECS - 1570
HeapsText DefinitionThe heap is a complete binary tree where each elements value is greater than the values of each of its children.All Sorts of SortsApril 7, 2005Now, all I have to do is define children, binary tree, complete binary tree, etc