Introduction to C++ - Computer Science and Engineering

advertisement
Introduction to C++
Penn State University
CMPSC 201 – C++ Programming for Engineers
Original class notes from Dough Hogan,
http://www.personal.psu.edu/djh300/index.htm
Class Information
 Class Meeting Time and Place
 Lectures/Labs: M/T/R/F 11:10Am – 12:25Pm
 Class Dates: 06/10/2010 - 08/11/2010
About Me
 I am a Ph.D. student at CSE department
 I work with Dr. Swarat Chaudhuri
 My area of research is Programming Languages, and in particular
Program Verification
 Email: ssn123@cse.psu.edu
 Office: IST Building, Room 337
 Office Hours: Monday, 2:00pm-4:pm/ Thursday 2:30pm-3:30mp
About TA
 Name:Orhan Kislal
 Email: omk103@psu.edu
 Office: IST Building, Room 346D
 Office Hours: Thursday, 12:30pm – 2:30pm
Prerequisite
 MATH 140, and MATH 141
 particularly the big-picture ideas (derivatives and integrals, how
they're defined, and what they represent)
 No programming experience is assumed!
Appropriate Course Selection
 CMPSC 200, 201, and 202 -- are targeted at engineers.
 CMPSC 121 is targeted at Computer Science and Engineering
majors.
 CMPSC 101 and 102 are targeted at a more general audience.
 The university will not count more than one of these courses
toward your degree program, so make sure you're in the right!
Textbooks
 Matlab Text:
Etter, Delores M. and David C. Kuncicky and Holly Moore.
Introduction to Matlab 7. Upper Saddle River, NJ: Pearson, 2005.
(ISBN 0131474928)
 C++ Text:
Y.Daniel Liang. Introduction to Programming with C++. 2nd ed.
 Optional C++ Text:
Mercer, Rick. Computing Fundamentals with C++. 2nd ed.
Wilsonville, OR: Franklin, 1999.
(ISBN 1887902368)
(Book are often sold with a disk we won't use.)
Primary resource
 Online course notes (originally provided by Dr. Doug Hogan) will
be your primary resource for the majority of the course.
 You will be expected to review the notes posted for lectures
before the next coming lab session.
 You'll experience the greatest success comprehending the material
if you spend some time with it outside of class between your first
exposure to it in lecture and your hands-on practice in lab.
 We will have a course website as ASAP! But before that everything
needed, including class notes, will be posted on Angel.
Other Materials
 C++ Compiler, available in the labs.
 You may want one at home for convenience. (See the Penn State
Computer Store for Visual C++ for PCs or try a free compiler
like Dev C++.
 For Macs, if you are running OS X, you have a free professional
development tool called Xcode that you can install from your Mac
OSX Install DVDs and learn from how-to page (in the course
website).
Other Materials (cont.)
 Your Notebook!!
 keeping a three-ring binder with your class notes, exams,
quizzes, and programming assignments, is recommended.
 You may find it useful during the course
 See the "Resources" link in the course website
Components of the Grade
 Quizzes and Other Class Participation Activities: (10%)
Quizzes may be given at any class session. Most will be
unannounced. We will occasionally take class attendance.
 Programming Labs: (20%) Short or medium length
programming assignments,
 given during the Monday/Tuesday/Thursday sessions.
 Labs can be either returned by the end of the lab session, or at
most by 10:00am before the beginning of the next class.
 The length and involvement of the activity will depend on the
topic. Some labs may build upon others.
Components of the Grade (cont)
 Programming Projects: (25%) More involved programming
assignments, completed out of class.
 Midterms Exams: (20%)
 Comprehensive Final Exam: (25%) Final exam is covering
programming concepts and theory from the entire course. The
exam date and time will be scheduled by the University later in
the term. Do not make travel plans before your final exam
schedule is available.
Components of the Grade
 Quizzes and Other Class Participation Activities: (10%)
 Programming Labs: (20%)
 Programming Projects: (25%)
 Midterm: (20%)
 Final Exam: (25%)
Programming Assignment
Guidelines
 See the Style Conventions
 Use the provided lab report template (but always check the
specific directions for the assignment to see what's required.)
 (Style Conventions and lab report template will be posted on
Angel).
 Following the style conventions will be important in grading.
 Assignments with extremely poor formatting may be returned for
reformatting and resubmission with penalty!
Autobiography
 Please type and print your answers to the questions in the
autobiography and bring a copy of your answers to the next
Monday class or send it to me through Angel.
Learning Goals
 Brief introduction to basic computer science theory, including
components of a computer system and their roles.
 Learn about how compilers work and the compiling and
debugging of code
 General programming practices such as
 the software development life cycle,
 programming style,
 documentation,
 algorithm design, and
 efficiency
Learning Goals (cont.)
 Sequential control flow and basics of C++ programming:
 input/output,
 declarations,
 keywords,
 mathematical operations,
 text/string manipulation,
 sequential control flow
Learning Goals (cont.)
 Selection control structures and their implementation in C++: if,
if...else, switch
 Loop control structures and their implementation in C++: for,
while, do...while loops
 Subprogram control structures (methods) and their
implementation in C++, including parameter passing and the
scope of identifiers
 File input and output streams in C++
Learning Goals (cont.)
 Arrays, one-dimensional and two-dimensional, including searching
and sorting
 Other programming techniques as they arise
 Using computer programs to solve problems in engineering and
science, particularly including numerical problem solving
techniques
 Basics of MATLAB software.
Download