CS-1004 — Introduction to Programming for Non-majors
A-Term 2018

(Catalog Description)


The traditional foundation of a solid education was captured by the phrase “Reading, Writing and Arithmetic.” Clearly reading and writing will never go out of style. However, because of power computers and handheld devices, arithmetic today bears scant resemblance to the arithmetic skills that your grandparents had to learn.

In its place is a new skill that transcends all disciplines — namely, the ability to program a computer to perform tasks on your behalf. Whether you are a scientist, a journalist, an historian, a writer or an engineer, programming enables you to multiply your abilities to save time, eliminate tedious tasks, solve problems that you could not otherwise solve, and outperform your peers who are not able to program.

Many do not realize the importance of programming in their disciplines; a goal of this course is to help you appreciate that importance and to take advantage of that skill.

Programming is not rocket science. Anyone can be taught to program. Do you think only runners in perfect condition can complete a marathon? You must know quite ordinary people who have run a marathon. To do so, you only need the desire and a plan to train your body to complete the task.

This is a course about programming, not computer science. To make an analogy, think of the usefulness of a spreadsheet program like Excel. You can use Excel to track purchases for a student club, to maintain your library of books, to produce reports of your MP3 files, to create charts for your science classes and labs. You can use Excel in so many ways; it is the same with programming.

In this class, you will learn how to program using Python, a modern programming language that is popular in many scientific and engineering disciplines. Along the way you will learn key concepts that will help you to learn how to be effective in MATLAB, C, Javascript or other languages that you might encounter.

If you are thinking about majoring in Computer Science — or one of the related computationally intensive majors such as Robotics or IMGD Tech — then this course is not for you. Please register for CS-1101 or CS-1102.


If you already know how to program in some programming language — for example, C, Java, Javascript, etc. — then this course may be too easy for you. Please consider relinquishing your seat to a student who has no programming background at all.


Goals and Outcomes
Logistics and Administrative Information

Office Hours and M.A.S.H.
Grading Policy
Students needing Academic Accommodations
Academic Honesty
Late Assignment Policy

Lecture Notes (password protected)
Homework (i.e., Programming) Assignments (password protected)
Laboratory Assignments (password protected)

Lectures for this course will be captured by the WPI Lecture Capture system. You may playback old lectures by visiting the following web address:–

Link to be provided

The Lecture Capture system records the voice of the lecturer, all material projected on the screen from the podium, and a live video of the front of the classroom.


The only prerequisites for this course are

(a)    an earnest desire to learn to program, and

(b)   a willingness to work hard at it.

For normal students, this means about 1½ – 2 hours of effort per day, seven days per week, in additional to attending classroom and laboratory sessions.

Learning a programming language is (somewhat) like learning to speak a foreign language. One has to speak a foreign language at least a little bit each day. Without that, there is no hope of being able to communicate at even the most basic level.

Likewise, one must use a programming language at least a little bit each day in order to achieve a modicum of proficiency in it.

Previous experience has shown that it does not work for students to concentrate all of their work just before assignments are due and/or just before quizzes.



CS-1004 has three main components:–

·         Classroom activities, during which we introduce new concepts and discuss their use in computer programs.

·         Homework, during which students write programs that are increasingly more challenging and useful.

·         Laboratory sessions, during which students can work thru class material and programming problems in an interactive setting with instructors and teaching assistants.

This course will have seven quizzes during the term, one each week on Thursday, starting on August 30, 2018. Collectively, quizzes will represent approximately 40% of the grade for the course, homework submissions will represent about 40% of the grade, and class and laboratory participation will represent about 20% of the grade.



This course will be conducted in the programming language Python, specifically version 3.6.5 of Python.

Why Python?

·         Python contains all the programming constructs and concepts that you would find in languages such as C, C++, Java, MATLAB, Maple, Javascript and countless other languages. Once you have learned these fundamental concepts, you will be able to quickly grasp whatever programming language comes your way.

·         Python offers an easier “learning curve” than other languages, while being just as powerful.

·         The scientific community has quickly embraced the use of Python. This language is not intended solely for Computer Science. Its syntax and style are simpler when compared with many other programming languages.

Note:  There are two versions of Python in use at WPI and worldwide, name Python 2.7 and Python 3.6.5. Python 3.6.5 is not compatible with Python 2.7. Programs borrowed from other sources using Python 2.7 will not work correctly this term.

You should plan to install Python 3.6.5 and additional packages needed for this course onto your personal computer or laptop. Instructions for installing Python on your Windows 7 or Windows 8 system can be found here:– docx, pdf. Instructions for setting up Python on your Macintosh system can be found here:– docx, pdf. If you have a Linux system, please consult the Professor.


Goals and Outcomes

Upon completion of this course, students should be able to:–

·         Understand how to write programs to solve problems

·         Use a debugger to single-step through a program execution

·         Write Python programs using appropriate programming constructs

·         Process data from keyboard input or files (binary and CSV)

We have identified a set of skills that you will learn and exercise in this class. These skills summarize the experience that one would have using any language. Once you have mastered these fundamental skills, you can apply your programming knowledge to learn new languages. Over time, as you become more proficient, you will make your own skill sets that will prove useful in your career.

The following URL contains a list of Python skills that we will work on during the term:– CS1004 Programming Skills



The textbook for this term is

Python Programming: An Introduction to Computer Science, 3rd edition, by John Zelle, published by Franklin, Beadle, and Associates, 2017.

This book is extremely inexpensive — it is in your interest to own a copy.

If you have access to the second edition (published in 2010), you may use it. However, you will be responsible for any differences between the second and third editions, including homework and programming assignments.


Logistics and Administrative Information

CS-1004 meets for four one-hour class sessions per week for a seven-week undergraduate term (28 hours).

Time and Place: Mondays, Tuesdays, Thursdays, and Fridays, 8:00 AM — 8:50 AM, Atwater-Kent 116, August 23 — October 11, 2018. No classes are scheduled for Labor Day, September 3. (On Thursday, September 25, 2018, WPI will follow a Monday schedule; this will have no impact on our class.)

Laboratory Sessions: All laboratory sessions will be held on Wednesdays, August 29 — October 10, 2018. Specific sessions are scheduled as follows:–

·         Section AX01:– Goddard 012, 8:00–8:50 AM

·         Section AX02:– Goddard 012, 9:00–9:50 AM

·         Section AX03:– Goddard 012, 4:00–4:50 PM

·         Section AX04:– Higgins Labs 230, 11:00–11:50 AM

·         Section AX05:– Goddard 012, 12:00–12:50 PM

Students needing to switch laboratory sessions should discuss their situations with the Professor. There is no need to change registrations to switch lab sessions. Most lab sessions are full, so students who miss scheduled sessions can only be accommodated in later sessions if there is space.

Professor: Hugh C. Lauer
Email: <professor’s last name>@wpi.edu
Office hours: see chart below; or by appointment
Office: Fuller Labs, Room 144

Graduate Teaching Assistant:
Hamid Mansoor <hmansoor> at wpi.edu
Office hours: Fuller A22 or Zoo Lab

Student Assistants:
Christopher Myers – crmyers at wpi.edu
David Swenarton – dbswenarton at wpi.edu
Joseph Turcotte – jaturcotte at wpi.edu
Vincent Miller – vcmiller at wpi.edu
Office hours are held at: Fuller A22 or Zoo Lab

M.A.S.H.:– (Math and Science Help)
MASH leader:– Saahil Claypool <smclaypool> at wpi.edu
MASH leader in training:– Kevin Nguyen <tnguyen> at wpi.edu

            MASH support tutors:– Craig Bursey, Jeff Estrada, Julian Lanson, Panos Argyrakis, and
            Will Lucca

M.A.S.H. Sessions: –

Class e-mail lists: Class e-mail lists will be managed primarily thru Canvas.
The following two e-mail lists in the cs.wpi.edu domain are backup to the Canvas lists:–
            cs1004-all at cs.wpi.edu — to reach all students, TAs, SAs, and the professor
            cs1004-staff at cs.wpi.edu — to reach just the TAs, SAs, and the professor

            You may also send messages to the Professor, TA, and SAs thru Canvas.

Course web site: http://web.cs.wpi.edu/~cs1004/a18.
To comply with copyright regulations, some of the web pages require you to log in. These will be hosted on Canvas, where you can log in with your WPI userID 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 and M.A.S.H

If none of these times work for you, please schedule a separate appointment.












Lab Section A01

(DS, JT)

(Goddard 012)







Lab Section A02

 (DS, JT)

 (Goddard 012)









Lab Section A04

(HM, VM)

 (Higgins 230)







Lab Section A05

(HM, CM)

 (Goddard 012)

















Lab Section A03

(CM, VM)

 (Goddard 012)




7:00-7:50 PM


HCL:–  Hugh C. Lauer
CM:–    Chris Myers
DS:–    David Swenerton
Joseph Turcotte
HM:–   Hamid Mansoor
VM:–   Vincent Miller
MASH leader:– Saahil Claypool

Office hours are held in Fuller A22 or the Zoo Lab next door. (These rooms are on the lowest level of Fuller, as far from the elevator as possible to go.)


Grading Policy

Final grades will be computed as follows:

·         Quizzes: approx. 40%

·         Homework assignments: approx. 40%

·         Class and laboratory participation and subjective assessment: approx. 20%

A grade of A generally means “exceeds expectations”; a grade of B generally means “meets expectations”; a grade of C generally means “does not meet expectations.”

There are plenty of extra credit opportunities during the course. Students who earn grades of A usually take advantage of many of these opportunities.

Previous experience suggests that approximately one-third of the class will earn grades of A, approximately one-third will earn grades of B, and approximately one-third will earn grades of C.

Satisfactory completion of programming homework is required for passing this course. Good grades on quizzes alone are no substitute for doing the projects and for attending laboratory sessions.

It is in your interest that the Professor and TAs/SAs know and recognize you by name.

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, the course includes seven weekly quizzes at the start of class every Thursday, beginning August 30 and continuing thru October 11. (Although WPI observes a Monday schedule on Thursday, September 6, 2018, we will have a quiz at the start of class that day!) Quiz dates are

August 30
September 6
September 13
September 20
September 27
October 4
October 11 (approximately 40 minutes)

Quizzes are open book and open notes and are typically twenty minutes in length (except the last quiz). You may start the 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.

If you finish early, please remain quietly in your seat to avoid disturbing your neighbors.

Quizzes are open-book, open-notes. You may refer to textbooks and notes on a reading device, tablet, or laptop. If a calculator is needed, you will be given advanced notice; in this case, you may use a calculator or a calculator app on your phone, tablet, or laptop. However, you may not do any computing or access any network during any quiz.

There are no makeup quizzes. The quiz portion of the grade will be based on your best five of the seven quizzes. This policy is intended to accommodate illnesses, absences from campus for any reason, or just plain bad days. If you must be absent from campus on a quiz day, please notify the Professor prior to the absence.

The last (i.e., “final”) quiz is mandatory for passing this course. Skipping the final quiz is tantamount to requesting a grade of NR for the course.

Quiz grading

The first six quizzes are worth 20 points each, and the final quiz is worth 40 points.

The quiz portion of the course grade is based on the best five out of the seven quizzes. To calculate the “best five,” we sum the five highest numerical quiz grades. We then take this as a fraction of 120 points, which is the maximum possible score from four weekly quizzes plus the final. This fraction represents the quiz portion of the course grade. See here for an additional explanation.


Submitting Homework Assignments        

All homework assignments must be submitted via the Canvas system. You will need to log in with your WPI username and password.

Canvas normally requires some getting used to. It is strongly suggested that you submit a “practice” or “dummy” file to Canvas prior to the due date of the first homework assignment, just to prove to yourselves that you can do it. Please make sure that the file is clearly labeled as a dummy so that we do not inadvertently count it toward your grade.

Students Needing Academic Accommodations

If you need course adaptations or accommodations because of a disability, or if you have medical information to share with the Professor that may impact your performance or participation in this course, please make an appointment with him as soon as possible.

If you have approved accommodations, please request your accommodation letters online through the Office of Disability Services student portal.

If you have not already done so, students with disabilities who need to make use of accommodations for this class are encouraged to contact the Office of Disability Services (ODS) as soon as possible to ensure that such accommodations are implemented in a timely fashion. This office can be contacted via email: DisabilityServices@wpi.edu, via phone: (508) 831-4908, or in person: Daniels Hall First Floor 124. 

Quiz and Test Accommodations for CS-1004 are as follows:– The Professor sends an electronic copy of each quiz to the Exam Proctoring Center (EPC) the evening before the Quiz. Students taking a quiz at the EPC should take it at the same time as students in the classroom. Students return to class as soon as they are finished and should bring their completed quizzes with them in sealed, signed envelopes, so that they may be graded in a timely fashion.

Under no circumstances may a student start a quiz at the EPC later then the finish of the quiz in the classroom. The reason for this restriction is that answers are distributed as soon as the quizzes are collected in the classroom.


Team Assignments

Some (but not all) homework assignments are two-person team assignments. For these, it is expected that both team members participate with roughly equal levels of effort in each assignment. 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 you are also testifying that your teammate has fully participated in that same assignment.

To work as a team, you must “register” by sending an e-mail to cs1004-staff@cs.wpi.edu. The Professor or one of the TAs will then create a “team” under the names of the team members in the Canvas system.

When you submit an assignment, Canvas will give you the opportunity of submitting for yourself or for your team. Make the appropriate selection.

Be sure to put the names of all team members on every file of your submission to Canvas. Submit only one copy of the assignment for the entire team. Do not submit duplicate copies under the individual team members’ names.

Please contact the Professor if you wish to change teams or divorce.

Academic Honesty

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 this course, you may help each other, but you may not look at or copy each other’s work or anyone else’s work.

·       You may take inspiration from the Web and other external sources, but you may NOT copy directly from any of them.

·       You may work out something on a whiteboard, napkin, back of envelope, etc., with anyone else. You may discuss your code with anyone outside the course.

·       You may not look at anyone else’s code (except your teammate’s)

·       You may not share your code with anyone else in this course or any future course (except with your teammate)

Once you have worked out a solution to a problem (possibly in consultation with others), you must write it up in your own words or code it in your own coding style. You must type any code into a file yourself. You may not copy from any electronic version and paste to your assignment. Retyping from an existing piece of code — whether electronic, printed, or handwritten — is indistinguishable from copying and is considered to be an instance of Academic Dishonesty.

For all assignments, the WPI Academic Honesty Policy applies:–


Violations of the Academic Honesty policy will be handled as specified in this document.

In the case of a violation involving a team assignment,
all members of the team are held to be equally responsible.


Late Policy

Late homework will be penalized 5% of the full value of the homework for each hour late up to two hours and 10% per hour after that. Timely submission is based on dates recorded by the Canvas system.

There are no grace days for this course.

Late penalties are not waived because of issues with Canvas. Be sure to check that you are able to submit to Canvas a sufficient amount of time before the assignment is due.

No or makeup programming assignments will be given. If you have special circumstances, contact the Professor at least 24 hours before the assignment is due.

All homework assignments should be submitted in accordance with the instructions provided with the assignment. Failure to conform to this rule will result in a zero for that assignment.

Other Stuff


One of the packages that we will use in this course is matplotlib, and specifically a package within matplotlib called pyplot. Pyplot is a useful tool for plotting graphs of all kinds, especially engineering and scientific applications. You don’t need to master this yet. However, if you are interested in reading ahead, a beginners’ guide for pyplot is here:–


Comprehensive documentation for matplotlib itself is over 2600 pages long and can be found here:–