Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to C Programming Lecture 2. C Tutor Schedule / 3rd Floor Lab b The lab and tutor schedule is available at the following URL:

Similar presentations


Presentation on theme: "Introduction to C Programming Lecture 2. C Tutor Schedule / 3rd Floor Lab b The lab and tutor schedule is available at the following URL:"— Presentation transcript:

1 Introduction to C Programming Lecture 2

2 C Tutor Schedule / 3rd Floor Lab b The lab and tutor schedule is available at the following URL: http://www.cocse.unf.edu/cislab/

3 What is telnet? b telnet is a utility program that allows you to create and execute programs on a remote machine. You will need to “telnet” into osprey (our UNIX machine) to work on your programs from home.

4 What is FTP? b The file transfer protocol (FTP) is a utility program that allows you to transfer files from one machine to another. You will use FTP to transfer files from Osprey to your home machine and vice versa.You will use FTP to transfer files from Osprey to your home machine and vice versa.

5 Better Telnet and FTP Programs b I found the telnet and FTP programs that I am now use on my home computer at: www.vandyke.comwww.vandyke.com b The telnet program is called “CRT” and the FTP program is called “Absolute FTP”. They provide graphical user interfaces.

6 What is an Algorithm? b An algorithm is a step-by-step procedure for accomplishing some task. Step 1Do Something Step 2Do Something Step 3Do Something. Step NStop, you are finished.

7 What is Computer Science? b Computer science is the study of algorithms. Studying the behavior of algorithms to determine if they are correct and efficient. Designing computer systems that are able to execute algorithms. Designing programming languages that allow formal expression of algorithms. Translation of algorithms into programming languages so they can be executed by the hardware.

8 Software Engineering b Define the Problem b Analyze the Problem b Design a Solution b Write the Code b Test the Code b Implement the Solution

9 Structured Analysis, Design, and Programming b Break the problem down until you have a collection of easy-to-solve subproblems. b Address each subproblem along with its interface to the overall problem. b Develop algorithms that can be expressed in a computer language. b Write your code in a consistent, easy-to-read, easy to modify style.

10 General Computer Organization b Central Processing Unit b Memory Main MemoryMain Memory –RAM (Random Access Memory) –Where your program is while it is executing RegistersRegisters –Where computations, etc. actually take place Secondary StorageSecondary Storage –Disk Storage –Where you save your files (programs and data) so they are not lost when the computer is turned off

11 Categories of Software b Systems Software Operating Systems, Compilers, Editors, etc.Operating Systems, Compilers, Editors, etc. b Applications Software Accounting Systems, Report Generators, etc.Accounting Systems, Report Generators, etc. b Firmware Systems software embedded in ROM (Read Only Memory)Systems software embedded in ROM (Read Only Memory)

12 What is an Operating System? b An operating system is a collection of software programs that control access to the machine. DOS, UNIX, & Windows are examples.DOS, UNIX, & Windows are examples. b Normally you don’t do anything on a computer without using the operating system.

13 What is a Compiler? b A compiler is a program that translates the source code (the program you write using an editor) into the machine language that the computer can execute. b We are using the gcc compiler that is available on the UNIX operating system.

14 The Process of Programming b After you have developed an algorithm to solve the problem: Use an editor such as vi or Pico to convert the algorithm into your source code (the program you write).Use an editor such as vi or Pico to convert the algorithm into your source code (the program you write). Compile the source code to create an executable program file.Compile the source code to create an executable program file. Execute the program by typing the name of the executable at the operating system prompt.Execute the program by typing the name of the executable at the operating system prompt.

15 What If it Doesn’t Work? b Debugging the Program Observe the messages that the compiler displays.Observe the messages that the compiler displays. Use your editor to look at the code you wrote.Use your editor to look at the code you wrote. –Try using the compiler messages to locate and correct errors. After correcting errors, you must recompile your code and execute it again.After correcting errors, you must recompile your code and execute it again.

16 Common UNIX Commands (1) b cat Display a fileDisplay a file b cd Change to another working directoryChange to another working directory

17 UNIX Commands (2) b chmod Set access mode for a file or directorySet access mode for a file or directory –$ chmod 700 /home/phigbee The above command will allow me to read, write, and execute files in my directory.The above command will allow me to read, write, and execute files in my directory. Students should set the access mode on their home directory the same way.Students should set the access mode on their home directory the same way.

18 UNIX Commands (3) b lpr Print filesPrint files b ls Display information about filesDisplay information about files b mkdir Make a directoryMake a directory b more Display a file one screenful at a time.Display a file one screenful at a time.

19 UNIX Commands (4) b mv Move or rename a fileMove or rename a file b rm Remove a fileRemove a file b rmdir Remove a directoryRemove a directory b pwd Show pathname of working directoryShow pathname of working directory

20 UNIX Commands (5) b logout (exit or lo on our system) Exit UNIXExit UNIX b kill Terminate a processTerminate a process b passwd Assign or change a password.Assign or change a password. b ps Display process statusDisplay process status

21 UNIX Commands (6) b who Display names of usersDisplay names of users b who am I Display login information about youDisplay login information about you


Download ppt "Introduction to C Programming Lecture 2. C Tutor Schedule / 3rd Floor Lab b The lab and tutor schedule is available at the following URL:"

Similar presentations


Ads by Google