19
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

Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

Embed Size (px)

Citation preview

Page 1: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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

Page 2: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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

Page 3: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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

Page 4: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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

Page 5: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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…

Page 6: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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.

Page 7: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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.

Page 8: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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.

Page 9: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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!

Page 10: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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)

Page 11: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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)

Page 12: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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)

Page 13: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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)

Page 14: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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

Page 15: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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

Page 16: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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.

Page 17: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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

Page 18: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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

Page 19: Agenda What is Computer Programming? The Programming Process Steps to Create Your Phobos Account Steps to Create a Program –Create Source Code with Text

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)