System Programming for
Non-Majors
CS 2301
D-Term 2014
CS 2301 is intended for non-computer science majors who are likely to need to write programs in C or other “low-level” computer languages in their studies at WPI and/or in their careers in their chosen professions. It is also intended for computer science minors and others who wish to take upper-level courses in the “systems” area of the computer science curriculum — including courses in Operating Systems, Networks, Distributed Systems, and Computer Architecture.
The following links are password-protected in accordance with WPI policy regarding the posting of copyright materials on course web sites. These links take you to the appropriate pages on myWPI; you will be asked to log in with your regular WPI user ID and password.
Lectures for this course will be “captured” by the WPI Lecture Capture system. You can playback old lectures by visiting the following web address:–
http://echo360.wpi.edu/ess/portal/section/1238f60c-0e8c-49cf-9ab5-a3df08af141b
CS 2301 assumes some
prior program design and coding experience. This may be a previous Computer
Science course at WPI such as CS
1101, CS
1102, of CS110X,
or it could be a computer programming course in high school using a language
such as Java or Python, or a job in which you had to write or participate in
the development of a non-trivial program in any programming language.
Students who
attempt to take CS 2301 as their first
computer programming experience generally leave the course in frustration after
wasting a few weeks.
Please note
that it does not usually work so well to take this course while carrying an overload.
CS 2301 has three main components:–
·
Lectures, which introduce and discuss the principle
components of the C language and the
most common data structures that technical professionals typically need when programming
in C. These data structures include arrays, strings, lists, and trees.
·
Programming Assignments, in which students write and debug
programs to use the C language constructs and data structures introduced in class.
There will be approximately six programming assignments, typically assigned on
Mondays and due at 11:59 PM about one week later. Timely completion of all programming assignments is required to pass this course. If, after a good faith effort to attempt an
assignment, it proves too difficult or there are fundamental things you do not
understand, then submit an incomplete assignment with your own analysis of your
difficulty. It is much better to submit
an incomplete assignment than to not submit one at all.
·
Laboratory sessions, in which students learn how to use the
various systems and tools needed to write and debug programs in C.
If you find
the laboratory assignments too easy, you may earn extra lab credit by helping
other students who find the assignments more difficult. Please inform the TAs
that you are doing so, in order that they can record the extra credit.
There will also be weekly quizzes, tentatively scheduled for Mondays except during Patriots’ Day week, and there will be a Lab quiz during the final lab session on April 30.
The following is an approximate outline of CS-2301, System
Programming for Non-Majors, for this term:–
Week 1 Introduction to the course, numerical computation in C, representation and format of numerical data, input and output, scanf() and printf()
Lab: “Hello, World!” program; editing and compiling in
Linux
Programming Assignment: Numerical calculations in floating point and fixed point
Week 2 Expressions, assignments, operator
precedence, loops, conditionals, and introduction to functions
Lab: for and while loops
Programming Assignment: Formatted calendar for an arbitrary year
Week 3 Functions, recursive functions; role of the
stack during execution
Lab:
the Linux make facility; using makefiles
Programming Assignment: User-defined functions
Week 4 Pointers, arrays, and strings; dynamic memory
allocation, malloc() and free(); introduction to command line arguments
Lab: introduction to the Eclipse integrated development environment
Programming Assignment: Arrays and pointers
Week 5 Structures, unions, and introduction
to lists and queues
Lab: the Eclipse debugger
Programming Assignment: Lists and queues
Week 6 Lists and queues; more about interfaces and
header files (only one class this week)
Lab: the Eclipse debugger
(continued)
Programming Assignment: Strings, malloc,
and trees
Week 7 Bit manipulation, bitwise operations, accessing registers; interfacing
with operating system
Lab: Laboratory Quiz to
demonstrate your ability to use a debugger
Programming Assignment: Strings, malloc, and
trees (continued)
Week 8 Final Quiz, Monday, May 5, 2014
CS-2301 meets for two 2-hour classes per week for a seven-week undergraduate term (28 hours).
Time and Place:
Mondays and Thursdays, 11:00 AM — 12:50 PM, Salisbury Labs 104
March 17 – May 5, 2013. There are no
classes on Monday or Thursday, April 21 and April 24, because of the Patriots’
Day holiday and WPI Project Presentation Day, respectively. However, there will be a class on Tuesday,
April 22, because WPI will
observe a Thursday schedule that day.
Laboratory Sessions: All laboratory sessions will be held in Goddard Hall, Room 012. Lab sessions are one hour each and are scheduled for Wednesdays at 2:00 PM, 3:00 PM, and 4:00 PM. Since the laboratory has a limited number of seats, students should normally attend the lab session for which they are registered. Temporary changes of lab sessions can be made with permission of the Teaching Assistants, provided that there are enough seats.
Professor:
Hugh C. Lauer
Email: <professor’s last name>@cs.wpi.edu
Office hours: (normally) 1 hour after each class; or see chart below; or
by appointment
Office: Fuller Labs, Room 144
Teaching
Assistant:
Zhongfang Zhuang <zzhuang> in the same domain
Office Hours:– see chart below
Office: Fuller A22
Student
Assistants:
Trevor Behlman <tsbehlman> in the WPI
domain
Ted Meyer <tjmeyer> in the WPI domain
Xi Wen <xwen> in the WPI domain
Office Hours:– see chart below
Office: Fuller A22
Textbook: Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language, 2nd edition, Prentice Hall, 1988.
Note: this is the classic textbook for the C language. Despite being more than 25 years old, it is still the best available, in the professor’s opinion. However, some students complain that there is not enough detail.
Alternative Textbook: P. J. Deitel and H. M Deitel, C: How to Program, any edition, Pearson-Prentice Hall, 2007 onward.
Note: this is one of the most widely used textbooks for C programming. An old, cheap, or online edition is perfectly satisfactory for this course. Some students complain that it has too much detail.
Class e-mail
lists: The following two lists are in the domain cs.wpi.edu:–
cs2301-all — to reach all students, TAs, SAs, and the
professor
cs2301-staff — to reach just the
TAs, SAs, and the professor
Course web
site: http://web.cs.wpi.edu/~cs2301/d14/
In order to comply with copyright regulations, some of the web pages will
ask you to log in. Please use your own WPI login ID and password.
Absences: Students
needing to be absent from class should notify the professor by e-mail or in
person as soon as possible. Likewise, students needing to schedule assignments
or presentations around religious holidays, projects, or interview trips should
notify the professor at the beginning of
the course.
Sunday |
Monday |
Tuesday |
Wednesday |
Thursday |
Friday |
Saturday |
|
9:00 |
|||||||
10:00 |
HCL |
||||||
11:00 |
Class |
Class |
|||||
Noon |
HCL |
ZZ |
|||||
1:00 |
HCL |
HCL |
HCL |
||||
2:00 |
XW |
Lab
Session D01 |
XW |
||||
3:00 |
TB |
Lab
Session D02 |
TB |
||||
4:00 |
Lab
Session D03 |
|
|||||
5:00 |
TM |
ZZ |
|||||
6:00 |
|
||||||
7:00 |
|
|
|
HCL — Hugh C. Lauer
ZZ — Zhongfang Zhuang
TB — Trevor Behlman
TM — Ted Meyer
XW — Xi Wen
Final grades will be computed as follows:
·
Quizzes and Laboratory Quiz: 40-45%
·
Programming assignments: 40-45%
·
Laboratory and class participation: 10-20%
Satisfactory completion of programming and laboratory assignments is required for passing this course. Good grades on exams alone are not a substitute for doing the programming assignments and for attending laboratory sessions.
If there are any circumstances that limit or restrict your participation in the class or the completion of assignments, please contact the professor as soon as possible in order to work something out.
In lieu of major exams, there
will be a quiz each week at the start of class on Mondays except during
Patriots’ Day week.
Quizzes will be approximately twenty minutes in length and will be open book and open notes. You may start each quiz as soon as you arrive in the classroom; quizzes will end at a designated time. Therefore, it is in your interest to arrive early and get a little extra time.
Quizzes are open book and open notes. If your textbook
and/or notes are on a computer, tablet, Kindle, or other kind of electronic
device, you may use it. However, you may
not do any computing or access any network during the quiz.
There are no makeup quizzes. The “quiz” portion of your course grade will be based on the best five out of seven quizzes. This is intended to help students accommodate absences due to illness, interviews, projects, etc.
The last two quizzes will be a laboratory quiz on Wednesday, April 30, conducted during
your lab session and a classroom quiz on Monday,
May 5 (same rules as above). The last
two quizzes are mandatory. Skipping either of these is tantamount to requesting
an NR in the course.
The purpose of the Laboratory quiz is to demonstrate to the Instructor or to one of the Teaching Assistants that you are capable of using Eclipse and its debugger to develop and debug a program. The quiz program will be distributed a day or so before the laboratory quiz; you will be asked a series of questions that require you to show how something is done.
Unlike an ordinary laboratory session, the Instructor and TAs will not help you during the quiz. Instead, they will be grading your skills.
Students with disabilities who believe that they need accommodations in this class are encouraged to contact the Disability Services Office (DSO) as soon as possible to ensure that such accommodations can be implemented in a timely fashion. The DSO is located in Daniels Hall. The Professor must receive requests for accommodations at least one week prior to a quiz.
Students are strongly encouraged to work together, help each other, reinforce each other’s knowledge, and consult experts and resources outside the course on all topics. Like most professional environments in your future, success depends upon how well you do when you have access to a full array of resources, not how much you remember by rote.
In the course, you may help each other, but
you may not copy each other’s work.
Once you and your classmates have worked out a solution to a problem, you must write it up in your own words or code it in your own coding style. Some assignments may be team assignments. For these, it is expected that all team members participate with roughly equal levels of effort. When you put your name on a team submission of an assignment, not only are you testifying that you have fully participated in that assignment, but also your teammates are also testifying that you have fully participated.
For all assignments, the WPI Academic Honesty Policy applies:–
http://www.wpi.edu/Pubs/Policies/Honesty/policy.html
Late programming assignments will be accepted within 24 hours of the due date. Each student will be allowed one late submission without penalty, except for the last assignment of the term. The graders will allocate this “grace period” to the first assignment that is submitted late. Additional late submissions will incur an automatic 25% penalty of the full value of the assignment. (That is, a late assignment worth 20 points would incur a penalty of five points, regardless of what grade is actually earned.)
Any assignment turned in after the 24-hour grace period will receive a grade of zero. No extra credit or makeup programming assignments will be given. If you have special circumstances, contact the Professor at least 24 hours before the assignment is due.
The last assignment of the term must be submitted on time, because of the need to complete the grading for the end of the academic year and graduation.
If submitted programming assignment fails to compile, the graders will make a good faith effort to contact the student. The student may fix and resubmit the assignment for a 25% penalty. If it is not fixed, the assignment will be graded as zero. Grace days may not be used for such resubmissions.
The C programming language exposes details of how the underlying hardware stores data and executes software. It is commonly used in situations where there is no support for higher-level languages — e.g., operating systems, device drivers, and embedded systems — and in specialized systems where no higher level languages have been implemented.
Upon successful completion of this course, the student should
·
Be
able to implement, test, debug, and document programs in C
·
Understand
how a program in a procedural language transforms data by changing the contents
of memory cells
·
Be
able to program with pointers and perform pointer arithmetic
·
Be
able to write programs that perform manual memory management
·
Understand
the concept of interface and how programs can be developed as modules
·
Understand
how programs are linked together
·
Understand
how to write and use functions and how the stack implements function calls
·
Understand
low-level input and output routines
·
Understand
and use the common data structures typically found in C programs — including arrays, strings, lists, queues, and trees
·
Understand
the representation of numeric data, including integers and bit fields
·
Use Linux commands to manage files and
develop programs, including multi-module programs and makefiles
·
Use a
debugger to step through a program, set breakpoints, and inspect variables