Upload
felix-cummings
View
214
Download
0
Embed Size (px)
Citation preview
Agenda
• What is Computer Programming?
• The Programming Process
• Steps to Create Your Phobos Account
• Steps to Create a Program– Create Source Code with Text Editor– Compile Program– Run Program
What is Computer Programming?
The job of a computer programmer is to give instructions to tell the computer what to do.
-Process Data-Store DataAccept input Provide output
(information)
Programming: The ability to tell the computer how data is to be processed
Steps to Create a Program
Determine Requirements for Program(Input, Outputs, formulas & processes)
Plan out Program
Write Program(Create source Code using text editor)
Compile Program(Convert source code to machine language)
Test (Run) Program
Phobos & Learn Accounts• In order to perform programming labs and
assignments, you will require a Phobos account.• You may have received (by mail) instructions on how
to obtain your Learn and Phobos accounts
– If you did not receive instructions on how to create a Phobos account (via mail), please see my course notes for link.
PHOBOSAccount to create, compile
and run programs
LEARNAccount to send and
receive e-mail messages
Steps to Create Phobos Account
Check Learn e-mailfor Phobos
username & password
Run Telnetapplication to
access Phobos acct.
Activate SIRISaccount
Learn accountcreated
Phobos accountcreated
1.
2.
3.
You will learn how to create your Phobos account inICS124 course…
What is the Telnet Application?
• Unix systems such as PHOBOS were originally designed to accommodate “dumb terminals” which were simply monitors and keyboards directly connected up to network
• Telnet allows the server to “think” that the user’s personal computer is a “dumb terminal”
• A common type of “dumb terminal” was Digital Equipment corporation’s VT100.
Telnet Application• To launch or “run” the Telnet application from
the Seneca computing lab, point and click onto the application “telnet” on the Windows 95 desktop
• You can obtain a free version of Telnet application for home use (assuming you have computer system with modem). More details in provided in ICS124 course.
Open Session
• For all Telnet applications, you must specify which server that you will connect
• For this Telnet application, you must point and click onto the File menu, select Open and type the server name (such as phobos).
• If you are logging in from another ISP you must provide the full domain name of the server (such as phobos.senecac.on.ca). Refer to ICS124 notes on where to access and download telnet application.
Logging Onto Your Phobos Account
• After you connect to the phobos server, you must type in your username (should be on your Seneca “one-card”) and your password.
• The password will be provided to you by an e-mail message in your LEARN account. It is important to get your LEARN account as soon as possible!
Learning Phobos Commands
• The operating system for Phobos is Unix, therefore it is recommended to learn Unix commands throughout this course
• How to Learn Unix Commands:– ICS124 Course– “Introduction to Seneca’s IBM RS/6000”
(at back of Subject Notes for IPC144)
Let’s Create a Program!
• In order to write programs, you need a text editor that can create, edit and save programming instructions (also referred to as “source code”).
• A text editor differs from a word processing application (such as MS-Word) in that it does not contain special formatting characters (that can cause programs when converting to machine code to run)
Nled Text Editor
• Types of Text Editors in Phobos– nled– pico– vi
• nled stands for “Neat Little Editor” and was written by one of Seneca’s Computer Studies’ Faculty members – Evan Weaver.
• Select a text editor that you feel comfortable using. (ICS124 course recommends nled)
Creating a Source File
• Logon to PHOBOS via telnet
• At the Unix prompt type
nled file.c <ENTER>
c extention indicates that fileContains C programmingInstructions (source file)
The Nled Text Editor
Common nled Commands:
<ESC><?> Displays help menu
<ESC><x> Save file & exit
You will learn additional nled commands in ICS124 course
Compiling a Program
After you use an editor to create a file containing your programming code, you are required to compile your source code to make the file executable. This compiling process converts your source file into machine language that the computer can understand and execute efficiently
Edited File CompilerExecutable
File
Compiling a Program• Although there is more than one Unix command
that may be used to compile a program, we will show you the cc Unix command.
• There are two different options of using the cc compiling command. One options creates an executable file called “a.out”, the other option allows the user to name the executable file.
Compile & Run Program
• At the Unix prompt in Phobos, type
cc file.c and press ENTER
• If there are no programming code errors, an executable file will be created called a.out
• You would need to type a.out followed by ENTER to run the program
Logging-off Phobos
• Always log-off of your Phobos account and exit the Telnet Application before you leave your terminal
• To log-off of your Phobos account, type the following command at the Phobos prompt:
logout <ENTER> (or exit or <CTRL><D>)
• After your session is disconnected, exit the Telnet application
Homework
• Please obtain study notes for IPC144 by Evan Weaver, and read pages 1 to 18 for next week’s classes.
• Try completing assignment #0 for practice (next week, I will show you how to send typescript file to the line printer)