Sunteți pe pagina 1din 29

CMPSC 200

Fall 2013
Lecture 1

August 26, 2013
Instructor and TAs
Dr. Susan L. Quick
Office: 111J IST
Phone: 865-9507
e-mail: quick@cse.psu.edu or ANGEL(do not
use any other e-mail!)

TAs: To be announced
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, and know how to find
files that you have created.
I will also expect you to read the book, answer the
problems in the book, read announcements and
attend lecture.
Take notes (come to class with pen/pencil and
prepared to take notes).
Copies of Lecture Material
Highlights of some 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 an e-mail to the entire class. (You will be
deducted points). If you have questions after
reviewing the notes, come to see me in my office.
Computer Use
MATLAB is available in the ITS labs across
campus.
You may also, but it is NOT required, purchase
a student version of MATLAB for your own
use.
It is recommended that you buy a USB drive
(jump drive, flash drive, etc.) to store your
programs..
If you do not already have U-drive space, you
may apply for U-drive space on ITS system.
http://clc.its.psu.edu/DiskSpace/UDrive/
Grades
Labs short MATLAB programs that you
complete during designated class times.
Homework Projects longer MATLAB 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 posted on ANGEL for grade
breakdown
Grade Maintenance
Programming project and lab submissions will be
by utilizing drop boxes on ANGEL.
It is your responsibility to ensure that you submit
the correct material to the correct drop box.
Items submitted to a drop box are automatically
time-stamped.
You will be able to review your scores via the
Grade Book Utility on ANGEL.
Drop boxes for Labs will be closed at the end of
your class time. Late policy for projects is posted
on ANGEL.
Academic Honesty
You may discuss MATLAB concepts during the in-class
labs, but each of you should turn in a completed lab
assignment that is your own work, not a collaboration.
If you receive help from anyone other than the TAs or
myself, you should document this help in your program.
If two or more submissions look similar, you will be
called into my office to face possible disciplinary action.
You are expected to complete the exams and quizzes
entirely on your own.
Student Questions
If you have questions about a 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.
I will have a short time at the beginning of each
class for administrative questions.
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 to you on ANGEL.
Fair
Fairness is usually a matter of opinion and can
be very subjective to circumstances.
I will try to be consistent.
If you have extenuating circumstances, then come
to see me in my office during office hours or by
appointment. Special considerations are more
likely to be granted if you do not ask for them in
a public forum. E-mail for special consideration
should only be used if you cannot physically
come to my office.
Why are you taking this course?
For most of you this is a required course which
means the curriculum committee for your major
decided it would be useful for you.
I have no control over this requirement. The
majors that have required this course have agreed
upon the topics to be covered. These topics
include problem solving, program design, control
structures, data types, graphics, and numerical
analysis using MATLAB as the language.
My job is to ensure that you are familiar with these
concepts for your future classes.
Class Format
One large lecture per week where all the sections
are together.
Cover larger or more general concepts
Two recitations in ITS labs every week.
The first recitation (on Wednesdays or Monday
afternoon.) will be used to demonstrate concepts with
you following along. Students using this time for e-
mail, IM, surfing web, or game playing may lose
points at my discretion.
Beginning next week, the second recitation (Fridays)
will be an in-class lab which you will need to turn in
by the end of class.
Practice
Like any skill, programming requires practice on a
regular basis.
Waiting until the day of the exam to practice, is like
a soccer team waiting until 2 hours before the game
to practice.
Read the book. Do the practice exercises. Keep up
with topics presented in class. Review posted
material.
Not everyone requires the same amount of practice.
University suggests that you spend 3 hours outside
of class for each hour spent in the classroom.
"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

Intelligence is learning from your mistakes,
wisdom is learning from the mistakes of others.
Questions ???

What is a Computer?
A programmable electronic device that can 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
CPU
Main
Memory
Output
Devices
Input
Devices
Secondary
Memory
display screen,
printer
keyboard,
mouse
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
ALU
Control
Unit
Instruction
(Input)
Result
(Output)
ALU Arithmetic and Logic Unit performs mathematical operations
Control Unit coordinates all of the computers 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
0 1 0 0 1 1 1 0 byte1
byte2
byte3
byte4
byte5
byte6
byte7
1 byte location, address 1
1 byte location, address 2
1 byte location, address 3

3 byte location, address 4
3 bytes needed to
store a large
number
Memory Locations 8 bits = 1 byte
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,)

Software
Operating Systems allocates computers
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
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
MATLAB
Name condensed from Matrix Laboratory.
Allows calculations and plotting in a graphical
user interface environment.
Used throughout engineering industries.
This course will be using MATLAB to illustrate
programming process and to encourage logical
thinking to solve problems
Writing Programs
Problem Solving Phase
Analysis and specification visualize what the
program will do.
General solution (algorithm) development
Verification
Implementation Phase
Concrete solution program
Testing have data available for which you know
the answer.
Maintenance Phase
Use
Maintain
Input, Processing, Output
Input data the user of the program will need
to enter into the program,
Output information the user expects to
receive from the program.
Processing what the program does to the
input to produce the output.
Examples:
Calculate the area of a rectangle
Questions
Read chapters 1 and 2 in the book
Read the syllabus and other administrative
items posted on ANGEL, there may be exam
or quiz questions based on the material in the
syllabus!

S-ar putea să vă placă și