Download CMSC 131 Fall 2008: Object-Oriented Programming I Course Overview and Instructions - Prof. and more Study notes Computer Science in PDF only on Docsity! 1 CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) CMSC131 Lecture Set 1: Introduction Topics in this set: 1. Course information 2. Tools needed for this course 3. Computer terminology basics 1CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) CMSC 131 Name: “Object-Oriented Programming I” Instructor: Jan Plane Class meetings Lecture sections 6 lecture sections 2 instructors Lab sections 11 lab sections 10 teaching assistants 2 2CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) Coordination of Sections Six sections total of CMSC 131 3 lectures taught by me other 3 lectures taught by Fawzi Emad Ten TAs in total for the sections All sections will be closely coordinated: Same lecture material on same day Same projects Same labs Coordinated exams Lab/Discussion/Recitation Sections exercises – laptops quizzes new material occasionally 3CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) What Is This Course? A fast-paced introduction to techniques for writing computer programs! Skill Development in Programming Conceptual Understanding of Programming Not really “computer science” There will be quite a bit of work but assumes you are starting at level 0. Keys to success Attend all classes and lab sections Start assignments early – and continue until you truly understand Get help early if you are having trouble – 2 instructors & 10 TAs Study every day it doesn’t work to cram for these exams ask questions as soon as you realize you are confused Check announcements on course web-page every day 5 8CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) Basics of Eclipse http://www.cs.umd.edu/eclipse/EclipseTutorial/ Eclipse is used to: Create Edit Compile Run Debug programs (for this class, Java programs). 9CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) Basics of Eclipse-speak Project: collection of related source files To create a program in Eclipse: Create a new project Create files in the project Perspective: framework for viewing and/or manipulating programs Important perspectives in this class: Java: for creating, running programs Debug: for tracing, removing errors in programs CVS repository: for interacting with assignment-submission system 6 10CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) Eclipse Demo 11CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) Class Projects with CVS You will use Eclipse for Java programming in this course How will you: obtain (check-out) files that are supplied to you save (commit) the files for later work turn in (submit) when you are finished class projects? CVS (= Concurrent Versions System) Tool for project-file management Maintains versions, etc. Allows different sites to work on same project 7 12CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) CVS Worldview Files in “repository” Server Files (local copies) Client 1 Files (local copies) Client 2 “checkout” “checkout” “commit” “commit” 13CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) CVS in More Detail CVS server maintains current versions of files in project (= “repository”) To access files from another machine (“client”), repository files must be “checked out” Changes to files on client may be “committed” to server, with changed files becoming new version (Once a repository is checked out by a client, subsequent versions may be accessed via “update”) 10 18CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) To Checkout a Project (cont.) 1. Open repository name, then “Head” 2. Right-click on project name to save 19CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) 11 20CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) Working on Project When you switch back to “Java” perspective, your project is now there! When you save in “Java” perspective, changes are automatically committed to CVS repository. 21CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) Submitting the Project Edit the file Make sure it runs correctly Submit the project for grading Go to submit.cs.umd.edu to see test results Public tests Private tests Release tests give limited feedback (first two failed tests give more) costs you “tokens” – usually 3 to start with spent tokens regenerate in 24 hours 12 22CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) Study Questions Login: study Password: daily 23CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) Computer Organization Hardware: physical parts of computer Monitor, mouse, keyboard Chips, boards Cables, cards etc. Software: non-physical (“logical”) parts of computer Programs = instructions for computer to perform 15 28CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) How Are Characters, Etc., Represented? Via encoding schemes Example: ASCII (American Standard Code for Information Interchange) Standard for encoding character values as bytes In ASCII: ‘A’ 01000001 ‘a’ 01100001 ‘,’ 00101100 etc. There are other character encoding schemes also: Shift-JIS, Unicode, etc. 29CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) Software Overview 1. Operating system: manages computer's resources; typically runs as soon as computer is turned on. Typical responsibilities: Process management Determines when, how programs will run on CPU time Memory management Controls access to main I/O, window system, network control Performs low-level drawing, communication operations Security Manages user IDs, passwords, file protections, etc. 2. Applications: programs users interact directly with; usually are explicitly run. Examples: Word processors Games Spreadsheets Music software, Etc 16 30CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) How Programs Are Executed foo.exe Program “foo” initially stored in secondary storage COPY Program copied into main memory CPU CPU executes program instruction- by-instruction 31CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) Programming Languages Used to write programs that run on computers Generations of programming languages 1st (1GL): machine code 2nd (2GL): assembly code 3rd (3GL): procedural languages 4th (4GL): application-specific languages 5th (5GL): constraint languages 17 32CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) 1st Generation: Machine Code Recall: computer data is 0’s and 1’s. In machine code, so are programs! Program: sequence of instructions Machine code: instructions consist of 0’s and 1’s Next slide: example machine code instruction from MIPS (= “Microprocessor without interlocked pipeline stages”) architecture Popular in mid-, late 90s Instructions are 4 bytes long 33CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) Example MIPS Instruction “Add data in addresses 1, 2, store result in address 6”: 00000000001000100011000000100000 ??? 000000 00001 00010 00110 00000 100000 opcode 1st address 2nd address destination address shift amount function specifier 20 38CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) Compilers Computers can only execute machine code Compilers are programs for translating 3GL programs (“source code”) into assembler / machine code source compiler asm 39CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) Interpreters Another way to execute 3GL programs Interpreters take source code as input Interpreters execute source directly Much slower than compiled programs Debuggers are based on interpreters Debuggers support step-by-step execution of source code Internal behavior of program can be closely inspected 21 40CMSC 131 Fall 2008 Jan Plane (adapted from Bonnie Dorr) Object Oriented Terminology Procedural Languages have procedures that can be reused Object Oriented Languages centered on the objects object principal entities that are manipulated by the program (nouns) class a “blueprint” that defines the structure for one or more objects method java term for a “function”, a “procedure” or a “subroutine” this is the code that does something (verbs) main method a special method that defines where program execution begins statements individual instructions