Description: Description: Description: Description: Description: Description: Description: Description: Description: Description: Description: Description: Description: logohome
System Programming for Non-Majors

CS 2301
D-Term 2012

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 non-computer science majors 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.

 Index

Prerequisites

Overview

Course Outline and Syllabus

Administrative Information

Grading Policy

Goals and Outcomes

Late Assignment Policy

 

The following links are password-protected in accordance with WPI policy regarding the posting of copyright materials on course web sites. When you attempt to access any page of these sections, you will be asked to log in with your regular WPI user ID and password.

Lecture Notes

Programming Assignments

Laboratory Sessions

 

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/8851bcd7-d022-4c0e-a5ad-b55d603a46f0

The Lecture Capture system in the classroom (Fuller 320) is only capable of capturing the lecturer’s voice and the materials projected from the computer to the screen. There is no “live video.”


Prerequisites

CS 2301 assumes some prior program design and coding experience. This may be a previous Computer Science course at WPI such as CS 1101 or CS 1102, a computer programming course in high school using a language such as Java, 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.

top

Overview

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 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. (Students who are already proficient in these tools may also earn laboratory credit by learning Microsoft Visual Studio and demonstrating to the professor or a TA their proficiency with those tools.)

 

There will also be three exams, tentatively scheduled for March 29, April 12, and April 30. See below for more information about exams.

top

Course Outline

The following is an approximate outline of CS-2301, System Programming for Non-Majors in D-Term, 2012.

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: using gdb, the Linux debugger

Programming Assignment: User-defined functions

Exam #1: Thursday, March 29, 2012

Week 4 Pointers, arrays, and strings; dynamic memory allocation, malloc() and free(); introduction to command line arguments

Lab: the Linux make facility; using makefiles    

Programming Assignment: Arrays and pointers

Week 5 Structures, unions, and introduction to lists and queues

Lab: Using DDD, the GNU Data Display Debugger                 

Programming Assignment: Lists and queues

Exam #2: Thursday, April 12, 2012

Week 6 Lists and queues; more about interfaces and header files (only one class this week)

Lab: Using DDD, the GNU Data Display 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 Exam, Monday, April 30, 2012

top

Administrative Information

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, Fuller Labs 320
March 12 – April 30, 2012. There are no classes on Monday or Thursday, April 16 and April 19, because of the Patriots Day holiday and WPI Project Presentation Day, respectively. However, there will be a class on Tuesday, April 17, because WPI will observe a Monday schedule that day.

Laboratory Sessions: All laboratory sessions will be held in Kaven Hall, Room 203. 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 Assistants:
Can Tatar <can> in the same domain
Yutao Wang <yutaowang> in the same domain
Office Hours:– see chart below
Office: Fuller A22

Senior Assistant:
Jackson Fields <jfields > 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.

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/d12/
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.

Office hours:

Sunday

Monday

Tuesday

Wednesday

Thursday

Friday

Saturday

 

8:00

 

 

 

 

 

 

 

 

9:00

 

 

 

 

 

 

 

 

10:00

 

 

 

 

HCL

 

 

 

11:00

 

Class

 

 

Class

 

 

 

Noon

 

HCL

 

 JF

 

 

1:00

 

 

 

 

  

 

 

HCL
1:30–3:30

HCL
1:30–2:30

2:00

 

 

Lab Session D01

(CAN, YW)

 

 

YW
1:00-3:00

3:00

 

 

Lab Session D02

(CAN, JF)

 

 

 

4:00

 

 

 

Lab Session D03

(YW, JF)

 

CAN
4:30-6:30

 

 

5:00

 

CAN
5:30-7:30

 

 

 

 

 

6:00

 

 

JF

YW
6:00-8:00

 

 

7:00

 

 

 

 

 

 

HCL — Hugh C. Lauer
CAN — Can Tatar
YW — Yutao Wang
JF — Jackson Fields

top


Grading Policy

Final grades will be computed as follows:

·         Exams and Laboratory Quiz: 40%

·         Programming assignments: 40%

·         Laboratory and class participation: 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.

Exams

Exams will be one hour in length and will be closed book, but students may bring one 8½ -by-11 inch sheet of prepared notes (two sides). You may not use any computers, calculators, mobile phones, music players, or any other electronic devices during the exams.

Prior to each exam, there will be a brief review period in which students may ask questions and discuss topics relevant to the exam.

There are no makeup exams. Absence from an exam will be excused only for medical or emergency reasons. A note from your doctor or from the Office of Academic Advising will be required. In extreme circumstances, the Professor will try to help you find a way to pass the course.

Laboratory Quiz

This term, we will introduce the notion of a “laboratory quiz” during which you will have to demonstrate to the instructor or one of the teaching assistants that you are capable of using a debugger to debug a program. Attendance at this quiz is required to pass this course.

Students with Disabilities

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 an exam.

Academic Honesty

Students are strongly encouraged to work together, help each other, reinforce each others’ 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 Policy and Grace Period

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 term.

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.

top


Goals and Outcomes

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

 

Mapping of course outcomes to CS Department Outcomes

top