Course Outline UPDATED 8/21/02

 

CS 1130 (ID:)      Introduction to UNIX and C     Fall Semester 2003

M,T,W,TH at 7am and 12pm in TE104 (also in Unix Lab)

 

 

Instructor

Name: Dr. David L. Ferro

Email: dferro@weber.edu

Web: http://icarus.weber.edu/home/dferro

Phone: 626-8095

Office: TE110c

Hours: MTWTh at 10-11am and Th at 9-10am 

Texts

Teach yourself UNIX in 24 Hours by Dave Taylor.

Teach Yourself C in 24 Hours by Tony Zhang.

 

 

Tentative Class Schedule, Topic Guide, and Assignments

Week

Starting

Topic

Chapters due

Work due on Thursday

1

Monday, August 25

Introduction to Class

UNIX – hours 1,2,3

 

2

Tuesday, Sept. 2

 

UNIX – hours 4,5

 

3

Monday,  Sept. 8

 Binary Numbers Help

UNIX –  hours 6,7,8

 

 

4

Monday, Sept. 15

Monday - EXAM 1

UNIX – hours 9,10,11

Work 1 due

5

Monday, Sept. 22

 

C – hours 1,2,3,4

Work 2 due

6

Monday, Sept. 29

 

C – hours 5,6,7

 

7

Monday, Oct. 6

 

C – hours 8,9

Work 3 due

Work 4 and 5 due

 

8

Monday, Oct. 13

EXAM 2   - Thursday –

Covers C hours 1 – 9

Test at student center testing center.  You may use a one page cheat sheet

C – hour 10

Work 6 due

9

Monday, Oct. 20

 

 C – hours 11,12

Work 7 due

10

Monday, Oct. 27

 

 C – hours 13,14

Work 8 due

11

Monday, Nov. 3

 

C – hours 15,16

Work 9 due

12

Monday, Nov. 10

EXAM 3 – Thursday –

Covers C hours 10 – 16

 

C – hours 18,19

Work 10 due

13

Monday, Nov. 17

  FERRO at COMDEX Wed, Thu.  Open lab.  Other help will be available

Give assignments to CS secretary

C – hours 21

Work 11 due

14

Monday, Nov. 24

TH is THANKSGIVING BREAK 

C – hours 17,22,23,

 

Work 12 due

15

Monday, Dec. 1

Wrap-up

 

Thursday – Final Exam –

You are responsible for entire course for final exam.  But, principally: C hours 17,18,19,21,22,23

Wrap-up

 Special Final Assignment due  last day of class (Thursday)

EXAM AVAILABLE THURSDAY (through next Monday) IN TESTING CENTER

FINALS

Monday, Dec. 6

 

 

MON  10-6 IS LAST DAY TO TAKE EXAM IN TESTING CENTER

 

 

Class Objective

To introduce students to the Unix operating system and the language “C” that it was written in.

Class Organization

Class will consist of lecture, discussion, and assignments on topics assigned through this outline and class assignments.  The instructor will expect the students to have read the covered chapters prior to classroom instruction.  The instructors will engage with the class to assure that learning occurs.

 

Emailing the professor: whenever you do this you must include in your subject line “class-name-subjectmatter”.  For example: “cs4830-davidferro-question about stephenson”.  This is very important for me to stay organized and I will ignore your emails if you persist in not satisfying this reasonable request.  I will respond that I have received your email.  Save my responses as they may be useful in the event of a conflict of opinion on whether you have sent me an email or not.  DO NOT SEND multiple copies of the same email.

Exams, Projects, Homework, Class Participation

Four Exams each worth 10%

12 Class Assignments each worth 4%

A special final assignment due at end of semester worth 10+ points

Class participation – 2%

Grading Policies

 

 

Final letter grades given final scores:

>= 94

A

90–93

A-

87-89

B+

84-86

B

80-83

B-

77-79

C+

74-78

C

70-73

C-

67-69

D+

60-66

D

<60

E

Note on Special Needs

Any student requiring accommodations or services due to a disability must contact the Services for Students with Disabilities (SSD) in room 181 of the Student Service Center.  SSD can also arrange to provide course materials (including this syllabus) in alternative formats if necessary.

WSU Student Code

Students are expected to be familiar with the WSU Student Code and abide by it.  The Code may be reviewed on line at http://www.weber.edu/ppm/6-22.htm (pay specific attention to Section 4D).  All necessary steps will be taken to enforce the Student Code to guarantee fairness to all students.

 

 

 

 

 

 

ASSIGNMENTS

 

All assignments will be written on the UNIX systems.  You will turn the assignments in at class time on the due date.  Late assignments will be docked 10% per week.  Each assignment will be turned in as follows:

- A printout of the source code.

- A printout of a run of the program and any input and output files.  (If the program is not interactive, you can use the tee command.  Example: %./a.out | tee <outputfile>.  If your program is interactive, you will have to use cut and paste.  Cut using the left mouse button, paste using the middle mouse button.).

- The comments in the source code will contain your name and the path name to the source code file on icarus.weber.edu so that I may find that file.

- The source code file will be readable by everyone so that I may access it if I so choose. 

Note: I will flunk you for cheating.  Cheating would includes turning in copies of other peoples code, and giving other people your code.  Helping others is appreciated and encouraged BUT when it comes to code, blatantly taking somebody’s stuff and turning in as your own is unacceptable.

Assignment 1: (UNIX worksheet)

Answer the following questions.  Turn in your answers as a printout or typed.

1. Why should you use uppercase, lowercase, special characters, and numbers in your password?

2. What are the differences between the commands mv and cp?

3. List two ways to use the chmod command to change the permissions on a file to allow the owner to have all privileges, the group to have only read and execute, and all others to have only the read privilege.

4. What flags can you use with the finger command?  What do they do?

5. Explain the purpose of at least two variables that you find when using the env command.

6. What is the alias command used for.

7. Convert 21310 to binary.

8. Convert 21310 to hexadecimal.

9. Convert 21310 to octal.

10. Convert 1010 1111 1010 to decimal.

11. Convert 1010 1111 1010 to hexadecimal.

12. Convert 34ACF416 to decimal.

13. Convert 34ACF416 to binary.

14. What command can be used to find a line of text within a file?  How do you use it?

15.  What is a pre-emptive multitasking, multiprocessing operating system?  What are the advantages of such an operating system? 

What will the following commands do? (I will be picky about these answers)

16. umask  755

17. cp  myfile.txt  ../bin/myfilenow.txt

18. cat  myfile.txt  >  myfile2.txt

19. rm  -i  ?bc*.txt

20. vi  myfile.txt  yourfile.txt 

21-25. Hand in an "ls -al" directory listing of files that you created with ONLY the following permissions.

- a file named truth.c that everyone can read.

- a file named output.h that everyone can read, write, execute.

- a file named swedin.doc that only the user can read and write.

- a file named buzzy.txt that only member of the group can write to.

- a file named joe that everyone can execute.

 

Assignment 2:

Write a program that prints out your full name and the values of two variables. 

Assignment 3:

Write a program that prints out a letter that the user inputs and prints out a number that the user inputs. 

Assignment 4:

Write a program that adds two numbers that the user inputs and  prints out the sum as decimal, octal, and hexadecimal numbers. 

Assignment 5:

Write a program that prints out all the ASCII values from 33 to 126.  Your printout will look like a table, showing the ASCII character, its decimal value, its hexadecimal value, and its octal value, line by line. 

Assignment 6:

Write a program that accepts from the user a letter and a number.  Print to the screen that letter the number of times that the user requested.  The user should be able to continuously run this program until they input the letter 'z' and the number '0'. 

Assignment 7:

Write a program that creates an array of 12 numbers and initializes them.  Print out the result of adding all the contents in the array and print out the result of multiplying all the contents in the arrays.  Use a loop to do this. 

Assignment 8:

Write a program that accepts a string as input and then asks whether to convert all the letters in the string to upper case or to lower case.  Then display the converted string.  Use a switch statement in this program. 

Assignment 9:

Write a program that accepts two numbers from the user and prints out the results of multiplying, dividing, adding, and subtracting the two numbers.  Each mathematical function must be in its own function.  All functions will have the two numbers passed to them.  You may not use global variables. 

Assignment 10:

Write a program that creates and initializes three variables (an int, a char, and a double) and also creates three pointer variables (an *int, a *char, and a *double) to point to each of the first three variables, respectively.  Print out the left and right values of all six variables in a nice table. 

Assignment 11:

Write a program that fills an array of structures with information on school classes (class number, course number, course name, room number, instructor, and number of students).  Fill in at least two full classes.  You can get this information from a file or put it inside the program itself.  Then display the contents of the array. 

Assignment 12:

Write a program that takes input from an input file and converts the entire file to upper case and puts the result into an output file.  Also hand in printouts of the input and output files. 
 

Special Final Assignment (due at end of the semester):

Write an address book program.  You must store the names, addresses, phone numbers, etc., in an array of structures.  You must have separate functions, accessed through a menu, that:

1) Allow you to enter information.

2) Allow you to search by each field.

3) Allow you to output the contents of the address book to a file.

4) Allow you to edit the information.

You must turn in the source code and a copy of the run.