Introduction (1)

Introduction (1) - COP 3330: Object-Oriented Programming...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
COP 3330: Introduction Page 1 © Dr. Mark Llewellyn COP 3330: Object-Oriented Programming Summer 2011 Introduction to Object-Oriented Programming Department of Electrical Engineering and Computer Science Computer Science Division University of Central Florida Instructor : Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http://www.cs.ucf.edu/courses/cop3330/sum2011
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
COP 3330: Introduction Page 2 © Dr. Mark Llewellyn Programming A program is a set of instructions to perform a given task. Typically the task solves some problem or part of a larger problem. In your CS classes, so far, you’ve learned the fundamental programming concepts, such as loops, assignments, conditional statements, and so on. Hopefully, you learned one or more ways to implement each of those constructs. You also learned that computer science is not just programming, but rather that programming is just a tool of a computer scientist.
Background image of page 2
COP 3330: Introduction Page 3 © Dr. Mark Llewellyn Programming What you might not have learned yet, are the advantages and disadvantages of the different ways to write a program to solve the same problem. For example, at a low level, there are many different ways to implement a structure such as a loop, e.g., you could use a for loop, a while loop, or recursion. At a higher level, there are many different ways to perform a task, e.g., a merge sort versus a selection sort. At even higher levels there are many different ways to divide a program into modules such as classes and methods. As an example of the latter case, consider the problem a writing a module that is supposed to maintain a collection of people and the dogs they own. Should the collection be a hash table or an array or some other kind of collection? Should the collection contain Person objects or maybe Person- Dog pairs of objects? Should each dog have an instance variable that points to its owner? Should owners have an instance variable that refers to a collection of dogs they own? If so, what kind of collection should it be? What other data should the Person object store? If the people are US citizens, do you need to store their social security number? If a person’s only dog dies, should that person be removed from the collection or left in as a person who owns no dogs?
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Introduction Page 4 © Dr. Mark Llewellyn Programming At this point you might reasonably ask whether the answers to these questions really matter. If two designs, one with few classes and methods and one with many, both solve a problem, does it matter which one you use? Similarly, if all versions of a loop correctly perform a computation, does it matter which one you use? If two algorithms both work correctly, does it matter that one is faster, especially given the increasing speeds of processors? The answer is:
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 16

Introduction (1) - COP 3330: Object-Oriented Programming...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online