Unformatted text preview:

Introduc on COMP 401 Spring 2013 Lecture 1 1 10 2013 How do we understand the world The Evolu on of Programming Simple programs are programmed simply A program can just be a sequence of instruc ons Each instruc on causes a change in overall state May employ simple loops and condi onal execu on i e if then statements The Evolu on of Programming As a program becomes more complex Refactor common sequences of opera ons into parameterized func ons or procedures Can be generalized and put into libraries that can be used across di erent programs The Evolu on of Programming As complexity con nues to grow Developing a program as recipe like sequence of instruc ons becomes increasingly di cult Need to be able to develop and understand our programming more like the way we understand the world As a set of interac ng abstrac ons With di erent parts of the program opera ng at di erent levels of abstrac on This is object oriented programming Object Oriented Programming Programs expressed as a set of so ware objects Each object is associated with a set of data and a set of func ons procedures that operate with that data Objects are de ned by their class Each class represents an abstrac on Abstrac ons o en layered on top of each other and or composited into more complex abstrac ons Key challenge is developing the appropriate abstrac ons The opera on of the program is the result of crea ng objects and having them interact with each other Major Themes Of This Course Abstrac on Encapsula on Inheritance Polymorphism Delega on Design Pa erns Asynchronous Programming Course Info Sakai Turning in assignments and as a gradebook Piazza Course notes resources Q A and all of other course related communica on Should have received an invita on email either last night or this morning If not come see me a er class h p piazza com unc spring2013 comp401 home Syllabus Review Who I am Who the TAs are O ce hours TBA Textbook Resources No required text Will be pos ng links to lots of on line materials on Piazza course resources page Prerequisites This should not be your rst introduc on to programming COMP 110 or 116 High school Hobbyist Profession experience If you have never programmed in Java before h p www oracle com technetwork java compile 136656 html h p docs oracle com javase tutorial java nutsandbolts index html Many others Your goal should be to get up to speed on basic syntax and control structures We ll be reviewing some of these today Assignments and Exams 8 programming assignments 2 midterms Friday 2 8 Friday 3 22 1 nal exam Saturday 5 4 12 00 noon Loca on TBA Grading 40 assignments 10 recita ons 15 x 2 midterms 20 nal Compu ng your grade Each component mapped to a 4 0 scale 4 0 A 3 0 B 2 0 C 1 0 D Assignments and recita ons will be mapped as follows 95 4 0 90 3 5 80 2 5 70 1 5 40 0 0 Exams will be curved Assignments May restrict the use of certain Java libraries and or features May require the use of certain programming techniques or approaches to the solu on Correctness is but one criteria for grading Elegance and readability will also count Some of the assignments will build on top of each other This can make things di cult if you don t get an assignment working You should keep working on an assignment un l you do get it working You will get credit for the assignment due next If you catch up you will get up to 50 credit for assignments that were originally late Honor Code Can discuss assignment solu ons at a high level but not at the level of code Code sharing chea ng You are allowed to pa ern your code a er anything I post i e class examples etc Can help each other debug but again up to the point of sharing or wri ng code for another person If it feel wrong it is wrong If you re not sure ask Recita ons Recita ons are mandatory A endance will be taken If you have a valid excuse you must no fy me in advance If missed for unforeseen circumstances sickness etc please be prepared to provide documenta on There will be graded quizzes exercises during recita ons You are free to go to any of the 4 recita ons but try to go to the one you are registered for The midterms will be held in recita on For these you must go to the recita on you are registered for Tomorrow s recita on is cancelled Adding The Course If you are not already registered we will be trying to accommodate everyone Assump on is that some of you will drop But if not we ll be ght Send email to Jodie Turnbull turnbull cs unc edu Subject Adding COMP 401 Include PID and choice of recita on Please cc me as well OO Programming Languages Almost all modern programming languages support some sort of object oriented programming Not all of them will do so in the same way There isn t just one way of being object oriented We ll be using Java Some things will be conceptual and will apply broadly to many other OO programming languages Some things will be speci c to the object oriented mechanisms provided by Java Installing the Java SDK Java SE Latest version is 7 update 10 Some mes referred to as 1 7 You want the SDK not just the JRE Available from Oracle at h p www oracle com technetwork java javase Mac Users Built in version of Java is 1 6 Strange rela onship between Apple and Oracle This should work for what we are going to do Latest version is available from Oracle But only for latest opera ng system i e Mountain Lion running on a 64 bit processor Eclipse Java based Integrated development environment IDE Not necessarily the best but reasonable free and fairly straightorward to use Available at h p eclipse org You don t have to use it for assignments but Some recita on exercises will require it so you need to have it installed I will be using it for examples in class Program Organiza on and Execu on All code in Java is organized into classes and interfaces One public class or interface per le Not strictly true but accept this as true for now Also don t worry about what an interface is for now Must match le name Classes can be organized into packages Again more on that later Java compiler javac produces byte code Java interpreter java executes program Need to specify a speci c class name as the main class Interpreter starts execu on with the method main Must be de ned with the signature public static void main String args Hello World 1 2 Open a plain text editor Create a le called HelloWorld java Enter the following …


View Full Document

UNC-Chapel Hill COMP 401 - comp401sp13lec01Introduction

Documents in this Course
Objects

Objects

36 pages

Recursion

Recursion

45 pages

Load more
Loading Unlocking...
Login

Join to view comp401sp13lec01Introduction and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view comp401sp13lec01Introduction and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?