Ryerson
University
Department of Computer Science
CPS118 -
Introductory Programming for Scientists
Course Outline and Course
Management Form (Fall 2010)
Professors
|
Dr.
Denis Hamelin |
Dr.
Joshua Panar |
Dr.
Hamid Timorabadi |
Dr.
Isaac Woungang |
Course
Description:
The C programming language is used to develop
good programming techniques. Topics covered include: C program form,
language statements, algorithmic representation, numeric data types,
flow of control with selection and repetition, standard C libraries,
functions and call modes, arrays, pointers, sorting, matrix
operations, character and string data types, dynamic storage,
structures and linked lists, file I/O.
Course
Format:
4 weekly lecture hours and 1 weekly lab hour.
Course
Websites:
www.courseweb.ca/cps118
and your professor's website for specific section information. (must
be consulted at least twice a week)
Course
Texts:
•Hamelin,
D. (2010), Introduction
to Programming Workbook, First Edition,
Dubuque: Kendall-Hunt. (course slides and exercises - highly
recommended)
•Hanly,
J. R. & Koffman, E. B. (2010), Problem
Solving and Program Design in C – Custom Supplement for Ryerson
University, 2nd
edition,
Boston: Pearson Custom Publishing. (exercises book)
•Pratap,
R. (2009), Getting
Started with MatLab,
Eighth
Edition;
Oxford University Press. (optional additonal reference)
•Gottfried,
B. (1996), Programming
with C - Second Edition,
Shaum's Outlines Series, New York: McGraw-Hill. (optional additonal
reference)
•CPS118 Lab Manual (available
on line) on the course website.
Optional
lab references:
•Academic
Computing Services (2004), User's
Guide to Academic Computing and the Internet,
Toronto: Ryerson University Bookstore. Also
available on line
•If your lab uses the facilities of the
Department of Computer Science (ENG Building), you will need this
user's guide.
Schedule of activities:
|
Week # |
Contents |
Format |
Book
Chapters |
Things to do |
|---|---|---|---|---|
|
1 |
Course introduction. Algorithms. Computer systems. Internal representations. Programming languages. Problem solving. Program development. |
Lecture |
Lesson #1 |
|
|
2 |
Introduction to C: Preprocessor directives. Comments. Structures of C instructions. Program skeletons. Variables. Identifiers. Rules for identifiers. Placeholders (formatting strings). printf and scanf statements. Reading/writing data from/to files (fscanf and frprintf). Reading/writing data from/to files (redirection using scanf and printf). Assignment operator (=). |
Lecture |
Lesson #2 |
|
|
3 |
Variables, Operators, and Expressions: Types of variables. Inaccuracies. Basic data types (int, double, char). Operators (+,-,*,/,%). Memory and pointers. Integer expressions (division). Double expressions. Mixed expressions. Explicit conversion (casting). Unary operator (-). Evaluating expressions (rules). Building expressions. Math functions (math.h). Other functions (abs, rand / stdlib.h). Increment(++) and decrement(--). |
Lecture |
Lesson #3 |
LAB #1 |
|
4 |
Logical Operators and Selection Statements: Comparison operators (<, <=, >, >=, ==, !=). Logical operators (&&, ||, !). Evaluating logical expressions. Building logical expressions. Comparing characters. if statements (one alternative, two alternatives, with compound statements, nested). switch statement. |
Lecture |
Lesson #4 |
LAB
#2 |
|
5 |
Repetition and Loops I: Theoretical kinds of loops (counting loops, sentinel loops, EOF loops, input validation loops, general loops). Loops in C (while statement, for statement). |
Lecture |
Lesson #5 |
|
|
6 |
Repetition and Loops II: Loops in C (EOF-controoled loops, do-while statement, input validation loops. Nested loops. |
Lecture |
Lesson #5 |
LAB
#4 |
|
7 |
Modular Programming and Functions: Concepts. Defining functions. Calling functions. Scope of names. Function with value arguments (no arguments/no result, 1 argument/no result, 2 or more arguments/no result, no arguments/1 result, 1 argument/1 result, 2 or more arguments/1 result). Number-Order-Types of arguments/parameters pairs. Using pointer parameters to simulate multiple results from a function. |
Lecture |
Lesson #6 |
LAB
#5 |
|
8 |
Arrays I: Numerical arrays of one dimension. Passing such arrays to functions (pointers and arrays). |
Lecture |
Lesson #7 |
|
|
9 |
Arrays II: Introduction to strings. Multidimensional arrays. Passing such arrays to functions (pointers and arrays). Vectors and matrices. Exercises on arrays. |
Lecture |
Lesson #7 |
|
|
10 |
Bitwise operators: Shifts and logical operators. |
Lecture |
Lesson #8 |
LAB
#8 |
|
11 |
Introduction to MATLAB: The MATLAB language. Variables and arithmetic pperators. Colon operator. Vectors. Matrices. Load and save. Transpose. Scalar product. Multiple initializations. Matrix indexing. Find operator. |
Lecture |
Lesson #9 |
|
|
12 |
Plotting and Programming with MATLAB: Plotting vectors. Plots in three dimensions. Surface plots. Bar graphs. Programming. User-defined functions. Selection and repetition statements. |
Lecture |
Lesson #10 |
LAB #10 |
|
13 |
Review |
Lecture |
|
NO LAB |
|
|
|
|
|
|
Evaluation:
|
Tests
and exams (70%) |
Labs
and assignments (30%) |
Important
notice: In order to pass the course, it is necessary to obtain 50% of
the tests and examination marks and 50% of the total marks. In
other words, your labs and assignments will not count if you do not
obtain the required minimum of 50% (35/70) on the term tests and
final exam.
General
Information:
The
term tests and final exam will consist mainly of writing C functions
and programs. There may also be questions related to specifying the
exact output produced by the execution of a given program, finding
errors in a program or filling the blanks in an incomplete program.
All
tests must be written in pen, not pencil.
The
labs will be graded based upon attendance and your complete devoted
attention to the activities specified in the lab manual. Attendance
for the entire lab period is required to avoid being marked absent.
Also, engaging in any activity other than the one prescribed in the
lab manual will give you an absentee status (a zero mark) for that
lab. Again, lab attendance and work is *mandatory*. If you get three
or more labs with a zero mark, you will get an F grade. If you do
have a valid reason to miss a lab (approved by the FYCSO), you will
make arrangements with your lab assistant to submit your lab by
email. Email submissions will not be accepted under any other
circumstance.
Assignments
consist of designing, writing and testing a program to solve a given
problem. Assignments and labs are to be done individually, and are
marked based on correctness of results, quality of documentation,
style and layout. Assignments and lab programs must contain the
following comment: /* This program is my own individual work */.
Copied work (both copy and original) will be given a grade of zero.
Involvement with plagiarism can ultimately result in course failure
and/or expulsion from the University in accordance with the Ryerson
Student Conduct Code. If you are found guilty of academic
misconduct the minimum penalty you will receive is a mark of zero on
the test, exam, paper, project or assignment in question and the
notation “Disciplinary Notice (DN)” will be placed on
your academic record and official transcript where it will remain for
eight years.
Late assignments will not be accepted for
marking. Assignments must be submitted in the format detailed in
class, and are to be submitted as directed by your Professor.
Assignments submitted in any other fashion are deemed void.
It
is important to know your CPS118 section number. Marks will be lost
on any evaluation missing proper identification, i.e. Family/Last
Name, Given/First Name, Section Number and Student Identification
Number (only if specifically requested).
Again,
a reminder that in order to pass the course, it is necessary to
obtain 50% of the (tests + examination) marks and
50%
of the total marks and
having
attended 8 labs or more.
Students
are responsible for logging on to the course website at least weekly,
and for following all course related instructions so transmitted.
Students
should also check their email (the ryerson.ca email as per academic
policy) daily for any notices from the Professors and are responsible
for following any directives so sent.
As
course topics typically develop based on material from previous
lectures, students are strongly urged to attend ALL classes. If you
miss any material due to illness or other unavoidable circumstance be
sure to catch up before the next class.
Grades on
assignments, tests and labs will be available on the Blackboard/RAMSS
system or other means specified by your Professor. As per Ryerson
regulation, final grades will be disclosed only by the registrar's
office.
A faculty course survey will be filled by the students
during week 11 (except during Spring and Summer terms).
Rules
and regulations:
The rules and regulations are for the
enjoyment and respect of everyone in the class including yourself.
Thank you very much for abiding by them:
Please refrain of
talking during the lecture. Everybody needs to hear correctly. If you
feel the urge to talk, you are invited to step out of the
classroom.
Please shut down you cell phone or put it in
vibrating mode during the lecture. If you are expecting an important
call, and do not have a vibrating function, please answer it
immediately and step out of the classroom to talk.
Please
arrive on time, class will promptly begin at :10 (on the hour for
Spring courses). If you arrive late or have to leave early, please do
so quietly and be nice and close the door behind you if it doesn't
close automatically.
Please be reminded that the Lab
Assistants have the authority of the professor in the lab sessions.
You are to treat the TAs with respect.
Emails to your Professor should always begin with a greeting (Dear Dr. X, Dear Professor Y) and be written in proper English (no chat room lingo please). Your should also always indicate your name (family, given in that order), course (CPS118) and section number in all communications. You must always use your ryerson.ca email to communicate with your Professor. Messages sent from other addresses (gmail, hotmail, ...) most likely will not be received nor answered. You may also use the official website's message centre to communicate with your professor or your lab assistant.
Changes:
Modifications
to the course procedures will be made in consultation with the
students and will be announced on the course website.