Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D...

23
Welcome to CPSC 206 Welcome to CPSC 206 Structured Programming in Structured Programming in C C

Transcript of Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D...

Page 1: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Welcome to CPSC 206Welcome to CPSC 206

Structured Programming in CStructured Programming in C

Page 2: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Instructor: Yu ChenInstructor: Yu ChenOffice: H.R. Bright Room 419 D

Email: [email protected]

Office Phone: 979-8624535

Office Hours: TR 2-3PM

other times by appointment Lecture: TR 08:00-09:15 AM, HRBB 124 Website URL:

http://people.cs.tamu.edu/ychen/Teaching/CPSC206/CPSC206.htm

Page 3: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

TATA

Page 4: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

In today’s lecture:In today’s lecture:

Course Description Lecture Topics Class Policy

Getting Started

Scholastic Dishonesty Assignments Examinations Grade Policy Vote

Page 5: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Course DescriptionCourse Description

CPSC206: Structured Programming in C

Basically, we need to write a set of instructions. By following this set of instructions, a computer can perform a desired task.

How to use a computer to perform the task?

Page 6: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Course DescriptionCourse Description

Which language should be used to write the instructions? Programming LanguageProgramming Language: Language with which we can communicate with the computer.

We call the process of specifying steps for a computer to perform a desired task as ProgrammingProgramming.

—— CPSC206: Structured Programming in C

Page 7: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

7

Course DescriptionCourse Description

To write instructions using C for the computer to perform a desired task.

Required text:Required text: A. Kelly and C. Pohl, C by C by DissectionDissection, 4th Ed., Benjamin Cummings, 2001.

—— CPSC206: Structured Programming in C

Language features of C

Programming techniques

Methods of documentation

Solution development for desired task

Page 8: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Lecture Topics:Lecture Topics:

0. Introduction to Computer Science1. Overview of C Ch 1, 2

2. Flow of control and functions Ch 3, 43. Character processing & fundamental data types Ch 5, 64. File I/O Ch 135. Pointers, Arrays, and Strings Ch 8, 9, 106. Structures, and linked lists Ch 12

Features of C:Features of C:

7. Enumeration type and storage classes Ch 7, 88. Recursion Ch 11

Page 9: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Class Policy Class Policy ——Scholastic Scholastic DishonestyDishonestyScholastic dishonesty will NOTNOT be tolerated.

Assignments: Working together on assignments can be a

meaningful learning experience, BUT the final product submitted must be the work

of the individualindividual student submitting the material.

Examinations: Offering to, or receiving any assistance from, a student will NOTNOT be tolerated.

Any identified incident of scholastic dishonesty will be dealt with severely.

Page 10: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Class Policy Class Policy — — AssignmentAssignment

All assignments will be announced in class and posted on the course web page.

Late Turn-in Policy: If you cannot turn in an assignment on time,

discuss the situation in advancein advance with the instructor.

Assignments should be submitted on or before the due day.

Assignment grades will lose 10% for each day late, up to a maximum loss of 100% (i.e., 10 days late)

Page 11: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Class Policy Class Policy — — AssignmentAssignment

DO NOTDO NOT copy other’s assignment! Otherwise, the grade = (-3) * the original grade. For example:

Bob gets a grade 99 for Assignment 4, but he is caught copying other’s assignment. Thus his grade for Assignment 4 is

(-3) * 99 = -297(-3) * 99 = -297

Page 12: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

If Bob did not submit the assignment 4Total scores: 98 + 87 + 67 + 99 + 88=439439Average score: 439/6=73.1673.16

Class Policy Class Policy — — AssignmentAssignment

Assume Bob’s grades for other five assignments are: 98, 87, 67, 99, 88

Then his final grade for the assignments isTotal scores: 98 + 87 + 67 + 99 + 88

- 297 = 142142Average score: 142/6=23.6723.67

It is worse than receiving a zero grade

Page 13: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Class Policy Class Policy — — ExaminationsExaminations

3 midterm exams There will be a exam review session before each

midterm exam. The schedule will be announced one week ahead in

class.

1 comprehensive final exam

Any student caught cheating on exam will receive a failing grade.

Page 14: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Class Policy Class Policy — Final — Final GradeGrade

Grade of Assignments

grade of assignments =

(Assign1 + Assign 2+ ……+Assign k) / k

Page 15: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Class Policy Class Policy — Final — Final GradeGradeGrade of Examinations:

sum_mid = midterm 1+ midterm 2 + midterm 3;

min_mid= min { Midterm 1, Midterm 2, Midterm 3 };If (min_mid <= Final) then

grade_of_exam = (sum_mid-min_mid+2*Final)/4;

else grade_of_exam = (sum_mid +Final)/4;

Policy 1:

Page 16: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Class Policy Class Policy — Final — Final GradeGradeGrade of Examinations:

grade_of_exam = (midterm 1+ midterm 2 +

midterm3+Final)/4;

Policy 2:

Vote: Policy 1 or Policy 2?

Page 17: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Class Policy Class Policy — Final — Final GradeGradeFinal grade:

30%*grade of assignment + 70%*grade of exam

Final grades will be assigned as follows: 90-100 A 80-89B 70-79C 60-69D below 60 F

The grade cutoffs might be lowered to accommodate the actual distribution of grades.

Page 18: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Getting StartedGetting Started

Get an account from Computer Science department. HRBB 210 http://helpdesk.cs.tamu.edu/new_user

Page 19: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Getting StartedGetting Started

Most of the assignments will be done on Unix.

How to connect to a Unix machine from a Windows machine?

Basic Unix commands. How to edit a file on a Unix machine? How to turn in an assignment?

Page 20: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Getting Started — Connect to Getting Started — Connect to UnixUnix

Connect to a Unix machine using PuTTY. http://helpdesk.cs.tamu.edu/docs/interactive_

putty Follow the instructions of part (b) to connect

tointeractive.cs.tamu.edu

Page 21: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Getting Started Getting Started — Basic Unix— Basic Unix

A useful website provided by helpdesk http://helpdesk.cs.tamu.edu/docs/unix_commands Unix is case-sensitive. Basic Commands:

cd dirname: Change directory pwd: Tells you which directory you are currently browsing ls: Lists your files mkdir dirname: Creates a directory vi filename: Edits a file cp file1 file2: Copies a file exit: Ends your SSH session

Page 22: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Getting Started Getting Started — Unix-based — Unix-based EditorEditor

Two commonly used editors are Pico:

http://helpdesk.cs.tamu.edu/docs/pico

Vi:http://helpdesk.cs.tamu.edu/docs/vi

Page 23: Welcome to CPSC 206 Structured Programming in C. Instructor: Yu Chen Office:H.R. Bright Room 419 D Email:ychen@cs.tamu.eduychen@cs.tamu.edu Office Phone:

Getting Started Getting Started — Turnin— Turnin

Assignments will be turned in via turnin turnin commandturnin classid filelist

classid is course_number-section-number

filelist is a space separated list of files to be turned in.

Example turnin 206-508 demo1You can check whether the file is correctly turned in by turnin –c classid

Example turnin –c 206-508