This preview shows page 1. Sign up to view the full content.
Unformatted text preview: CMPSC 201C Spring 2008 Lecture 1 January 14, 2008 Instructor and TAs Dr. Susan L. Quick Office: 111J IST Phone: 865-9507 e-mail: [email protected] (do not use any other e-mail!) TAs: Bikash Sharma and Athichart Tangpong TI: Ben Hvostal Course Expectations No previous programming experience is expected. However, do expect you to be familiar with windows, know how to save files, know how to use folders and subfolders. I will also expect you to read the book, answer the problems in the book, read announcements and attend lecture. Take notes. Copies of Lecture Material Highlights of the lecture presentations will be placed on ANGEL prior to class meeting time. However, you will be expected to supplement these highlights with notes you take during class. The highlights may be removed from ANGEL without notice after class period is over. If you miss class, identify someone from your section from whom you can copy the notes. Do not send a class e-mail. (You will be deducted points). Computer Use Microsoft Visual C++.net is available in this lab or any of the ITS labs across campus. If you elect to use Borland C++ be aware that you are responsible for any differences in operations. It is recommended that you buy a USB drive (jump drive, flash drive, etc.) to store your programs.. You may apply for U-drive space on ITS system. http://clc.its.psu.edu/DiskSpace/UDrive/ Grades Labs short C++ programs that you complete during designated class times. Homework Projects longer C++ programs that you write to complete a task. Guidelines for how the program is to be written will be given. Exams test how well you can read/understand code, know history and theory of the programming, and create short segments of code. Quizzes unannounced, based on material from lectures, assignments and readings in book. See syllabus for grade breakdown Grade Maintenance Programming project and lab submissions will be by utilizing dropboxes on ANGEL. It is your responsibility to ensure that you submit the correct material to the correct dropbox. Items submitted to a dropbox are automatically time-stamped. You will be able to review your scores via the Grade Book Utility on ANGEL. Academic Honesty You may help each other with the in-class labs, but each of you should turn in a completed lab assignment that is unique for you. You may be allowed to work with one other person from your section on some homework assignments. Each of you should submit your program to the dropbox and your comments should state with whom you worked. If you receive help from anyone other than the TAs or myself, you should document this help in your program. You are expected to complete the exams on your own. Student Questions If you have questions about a C++ or MATLAB concept presented in class, please ask! Others may have the same question, and your questions usually indicate that you are paying attention and thinking. You are responsible for reading the syllabus and announcements. Do not misuse class time, your time, and my time with questions about material that is readily available "Perhaps the most valuable result of all education is the ability to make yourself do the thing you have to do, when it ought to be done, whether you like it or not. " -Thomas Huxley "Thinking is the hardest work there is, which is the probable reason so few engage in it." -Henry Ford Questions ??? What is a Computer? A programmable electronic devicethat canc store, retrieve and process data. Tool that makes a job easier Advantages Reliable Fast Does not tire Follows instructions (programs) precisely Disadvantages Not "smart" cannot analyze problems Follows instructions (programs) precisely What can a computer do? Simple arithmetic Comparisons/decision making Communication-input, output, transfer of data. Components of a Computer Input Devices CPU Output Devices keyboard, mouse Main Memory display screen, printer Secondary Memory harddisks, floppy disks, tapes, CD-ROMs CPU - Central Processing Unit fetches and follows a set of simple instructions (also called processor). Main Memory stores the executing program and its data in RAM (random access memory). Volatile Secondary Memory stores permanent records (files). Non-volatile Central Processing Unit Instruction (Input) ALU Result (Output) Control Unit ALU Arithmetic and Logic Unit performs mathematical operations Control Unit coordinates all of the computer's operations, performs the fetch/decode/execute cycle Fetch: Control Unit fetches next instruction Decode: Control Unit decodes instruction Execute: instruction is executed by appropriate component Main Memory Main Memory consists of a long list of numbered memory locations (RAM). Main memory is volatile! Memory Locations contain zeros and ones, on and off switches, called binary digits or bits Each memory location or byte is identified by an address Memory Locations byte1 byte2 byte3 byte4 byte5 3 bytes needed to store a large number byte6 3 byte location, address 4 0 1 0 0 8 bits = 1 byte 1 1 1 0 1 byte location, address 1 1 byte location, address 2 1 byte location, address 3 byte7 Secondary Memory Uses same idea of bits and bytes Programs/data stored in units called files. Stores files when they are not in use Non-volatile Examples: Hard drives CDs & DVDs USB drives (jump, flash,) Networks Networks are computers that are connected together in some manner to share resources. Local Area Networks LANs usually share hardware resources within a building or small area Wide Area Networks WANs connect LANs and computers in a larger area. Software Operating Systems allocates computer's resources and allows communication between user and computer. UNIX, DOS, Linux, Windows, VMS, etc. Programs set of instructions to perform specific tasks. Program Data Computer Output - Information Algorithm vs. Program Algorithm - set of well-defined steps for performing a task or solving a problem Program A set of instructions a computer follows to perform a task. An algorithm that has been translated into a programming language so the computer can "understand" and perform the steps. Programming Language special language used to write programs. Programming Languages High-level languages: designed to be easy for humans to read and to write programs in, but too complicated for the computer to understand (see Table 1.1) Z=X+Y Low-level languages: consist of simple instructions which can be understood by the computer after a minor translation ADD X Y Z Machine Language: written in the form of zeros and ones, can be understood directly by the computer 0110 1001 1010 1011 Programming Languages COBOL (COmmon Business Oriented Language) FORTRAN (FORmula TRANslation) BASIC (Beginner All-purpose Symbolic Instructional Code) Pascal (named for Blaise Pascal) Ada (named for Ada Lovelace) C (whose developer designed B first) Visual Basic (Basic-like visual language developed by Microsoft) C++ (an object-oriented language, based on C) Java Translating High-level to Machine code Source Code Source file created by a text editor *.cpp Preprocessor Modifies source code by instructions (#) Modified Source Compiler Object Code Translates to Machine Code *.obj and checks for syntax errors Object Code Combines various object code files to create an executable file *.exe Linker Executable Code Questions Read chapters 1 and 2 in the book Read the syllabus, there may be exam or quiz questions based on the material in the syllabus! ...
View Full Document
This note was uploaded on 03/19/2008 for the course CMPSC 201 taught by Professor Susanquick during the Spring '08 term at Pennsylvania State University, University Park.
- Spring '08