Title: Windmilling Project
1BIL101E
UNIX OPERATING SYSTEM- Review Labwork
-PROGRAMMINGAlgorithms and Programs
Turgut YilmazOffice 244E-mail
turgut.yilmaz_at_itu.edu.trwww.mkn.itu.edu.tr/yilma
ztur
2Operating Systems Overview
- Review of UNIX Commands
- Lab work - Unix
3Review of UNIX Commands
4UNIX Commands Starting and Ending
Logging in Enter your username password t
o login to the system. If login successfully,
you will see Unix Prompt
5UNIX Commands Starting and Ending
telnet Connecting to another machine e.g. telne
t hyperion.labs.itu.edu.tr telnet
mecheng.strath.ac.uk telnet atlas.cc.itu.edu.tr
When connected, it will ask your username and
password
6UNIX Commands Starting and Ending
Logging out when you have finished, you must log
out exit or logout
7UNIX Commands File Management
vi or pico or Emacs or joe To edit text
files mkdir Creating a directory cd
Changing your current working directory ls
Finding out what files you have cp Making a
copy of a file mv Changing the name of a
file rm Getting rid of unwanted
files chmod Controlling access to your
files cmp or diff Comparing two files wc
Word, line, and character count
8UNIX Commands To Get Help
To get help man commandname To get
help man ls man man
9UNIX Commands Files
Use help option man to find out what these
commands are for
tail chmod file spell diff
pg cat touch head
10UNIX Commands Communication
pine Using Pine to send and receive
e-mail talk Talk to another user write
Write messages to another user ftp
Transferring files with ftp telnet Connecting
to another computer
11UNIX Commands To Get Help
To get help man -k keyword e.g. man -k
print
12UNIX Commands Information
man Manual pages quota -v Finding out your
available disk space quota df and du Info about
disk usage finger Getting information about a
user passwd Changing your password who
Finding out who's logged on
13UNIX Comments Printing
lp or lpr Printing cancel or lprm Removing a
print job
14UNIX Commands Job Control
ps Finding your processes kill Killing a
process nohup Continuing a job after
logout nice Changing the priority of a
job To run a background process
15From Algorithms to Programs
Algorithm and Flowchart Programming and
Programming Languages
16Software Development
Understand the problem
Come up with an algorithm
Implement it in a program
17Algorithm A methodical approach to solve a
problem
Example The algorithm to compute the average of
N Numbers is to add them up and then divide by N
Flowcharts are used to describe algorithms
18What is a program?
A Program is a precise expression of an
algorithm in a language that could be followed
by a computer
19More About Algorithms
- An algorithm is made up of a set of basic steps
- that are followed sequentially.
- Each algorithm must have a single entry point.
- Each algorithm must have one or more
exit/finish points
Flowcharts are for us to visualize the algorithm
20More About Algorithms
Problem You are given 100 or more numbers
written on a card and asked to find the
highest number.
Algorithm Go through the cards (one at a time)
and remember the highest you have encountered
so far.
21More About Algorithms
Problem You are given a list of 100 or more
numbers. SORT them in a descending order.
Algorithm - Find the largest number by going
through the list - Find the second largest in
the remaining list - Find the 3rd largest in
the remaining list - ... - Until the
remaining list is empty.
22Flowchart Sorting a List of Numbers
23Flowchart Symbols and Their Meanings
24Programming and Programming Languages
- Programs are precise instructions expressed in
a programming languages. - The only language computer can follow are low
level machine instructions. - Writing machine language programs are difficult
and most of the time not necessary.
25Computer Languages
- Low Level languages
- - Difficult to learn and use
- - Examples include machine and assembly
languages - High Level languages
- - English-like vocabulary
- - Examples include C, Fortran, Pascal, Java,
Cobol etc.
26Interpreters and Compilers
To translate a program into machine language
requires translator software.
Interpreters each instruction is translated
individually when needed during execution
Compilers The entire program is translated into
machine language before execution
27Into the Computer
- A high-level program needs to be written using
text editor. - Once typed into the text editor, it can be saved
to disk. - To run the program, it must be translated into
machine language - by means of an interpreter or compiler.
28Edit-Compile-Execute cycle
29Programming Approaches
- Structured Programming
- A technique used to make programming easier.
- Many small programs are written and then
combined. - Object-oriented programming
- The program is a collection of interactive
objects that - contain both data and instructions.
- Visual Programming
- Programmers write programs by drawing pictures
and - pointing to objects on the screen.
301st Midterm Exam !
- Possibly 13 March 2003
- Online exam, 2 stages
- 1st stage 40 questions in 20 minutes
- YES, NO, NO ANSWER type of questions
- 70 weighting
- 2nd stage 10 questions in 10 minutes
- filling in empty spaces
- 30 weighting
- Timing exam ends when you press TAMAM
- or when the time is up.
- 3 wrong answers cancel 1 correct answer
- 5 No answers cancel 1 correct answer
- Questions are from chapters 1, 2, 3 and 4