CSC105, Introduction to Computer Science I. Introduction. Perl Directions NOTE : It is also a good idea to

Size: px
Start display at page:

Download "CSC105, Introduction to Computer Science I. Introduction. Perl Directions NOTE : It is also a good idea to"

Transcription

1 CSC105, Introduction to Computer Science Lab03: Introducing Perl I. Introduction. [NOTE: This material assumes that you have reviewed Chapters 1, First Steps in Perl and 2, Working With Simple Values in Beginning Perl.] Perl is a general- purpose programming language, which was developed originally by Larry Wall in His original intention was to create a powerful scripting language to use in Unix operating system environments. Perl is basically an interpreted language. This implies that programs in Perl can be executed either as scripts (saved text files) or interactively using a command- line terminal utility. The original power of Perl was its flexible text processing capabilities and ease in handling text files. Today, Perl has been extended for use in a wide variety of application domains. CGI graphics programming for the Web, for managing the development of large software projects, system administration, network programming bioinformatics, and more As a programming language, Perl looks ugly. Its source code is populated by all sorts of strange symbols and combinations. But, when you become a little more experienced with Perl, you will appreciate that sometimes ugly is beautiful. Compared to other programming languages, Perl programs pack a lot of power in a small package. Directions. In this lab, you will explore programming with Perl in a series of separate activities. Create a folder on your desktop named with your last name + Lab01. For example, mine would be called allenlab01. This will serve as the home location for all of your programs or scripts. You will also submit this folder electronically when you complete the lab activities. Keeping it on the desktop makes it easier to find and use. (NOTE: It is also a good idea to

2 save this folder to your flash drive after your have completed work. The lab machines are configured to erase any data that you create when you logout. So, saving it is a good precaution if there are any problems with submitting the work.) II. ACTIVITY: Creating and Running Your First Perl Program. 1. Programming Perl on the Macintosh platform offers several advantages. The operating system, Mac OS X, is actually built on the platform of Unix. This means Perl is already installed on your system. Macintosh also has a Terminal application that provides direct access to Unix commands and Perl. 2. Many Perl programs are written as scripts that are saved as plaintext files. The advantage of scripting is that these programs can be reused. Having a text file version of the program also makes it easier to correct or modify the program for other uses. The Macintosh system has a text editor application called TextEdit. However, we will use another text editor instead the application, TextWrangler. This is Mac- only freeware from BareBones software that offers some decided advantages for writing programs: automatic formatting and code marking facilities for a number of programming languages including Perl, automated commands for running programs convenient file handling facilities. 3. Look for the application icon in either the Dock or Applications folder. The TextWrangler icon. 4. Initially, TextWrangler will open to an empty document as seen in Figure 1. Figure 1: TextWrangler opens a new text document. Examine several of the menus: File, Edit, and Text. You will recognize most of the commands from your experience with other applications. In addition to the familiar menu items, note that there is one unusual looking one: #!. This is called She- Bang or sometimes Pound- Bang. We will use it to run or execute our programs. 5. As a first step, we will enter our first program. It is traditional for most programming languages to commence with the Hello, world! program. (This is especially fitting, - 2-

3 because the practice was introduced by Kernighan and Ritchie in their groundbreaking text on the C programming language. Perl s core interpreter is written in C.) Enter the following text into the document window: #!usr/bin/perl print Hello, world!\n ; 6. Use Save As to save the file. Enter the name hello.pl and locate the file on the Desktop. NOTE: At this point, drag the file to your folder. We want to save all of our work there, and TextWrangler will make the necessary adjustments when we run it. 7. From the #! menu, select the Run command, i.e., with the ellipses as shown in Figure 2 below. Figure 2: The Run command dialog box Notice the selections checked: chdir to script s folder makes your submission folder the working directory. (Perl will expect to find any referenced files in that directory unless you indicate otherwise.) Unix Script Output directs the output to a special window for review. Clear before writing empties the window s content before your output. (This is important so that you won t confuse the output from a previous version of your program with the current version s output!) Press the Run button. 8. The results should look like those in Figure 3. Figure 3: The Unix Script Output Window. - 3-

4 9. Congratulations! You are now a Perl programmer. The meaning of the program should be fairly clear. If not, here are some details: the she- bang operator signifies where Perl is installed on your computer. print is an operator that outputs whatever values follow it. Hello, world! is a string literal. the \n inside the string is called the newline symbol and instructs the process to put a carriage return at the end of the string, i.e., end the line and advance to the next. 10. Let s modify our program to demonstrate something else. Change the print line to read: printx Hello, world!\n ; Notice that the editor immediately changes printx to black, which signifies normal text. Previously, it was colored blue. This means that it is a recognized Perl operator keyword. So, you should already be suspicious about the change. Save the change and Run it. You can select the Run command without the ellipses because your previous settings are preserved until you change them. The results should look something like those in Figure 4. Figure 4: Error Messages The moral is that TextWrangler will display the error messages and warnings that a faulty program might generate. The error messages give you a general idea of what and where problems occur. However, they are not always illuminating. So, when you are trying to debug (correct) your program look first where the compiler recognizes the error. Try to decipher the error based on what the last line executed. Your semantic abilities will always outshine those of the compiler. Also, keep in mind that all programming languages are formal and, therefore, very rigid. So, the smallest typo can wreak havoc in your code. [I would like to say that this is the last error you will ever make coding Perl. But, I will leave empty promises to politicians.] - 4-

5 III. ACTIVITY: Working With Numbers 1. As you read in Chapter 2, Working with Simple Values, Perl treats all single values as scalar data. Scalar values can be written as literals (i.e., the actual value) or using scalar variables, that is, a name that you create but prepended with a $ symbol. Scalar data is divided into two categories: numbers and (text) strings. Here are some examples expressing numbers. (NOTE: the # symbol is used to introduce a comment, that is text added by the programmer to explain to humans what is going on. The Perl interpreter ignores all comments.) # expressed as a real number 255 # expressed as an integer 2.55e2 # expressed as using floating point format 0377 # expressed in octal with a leading zero 0xff # expressed in hexadecimal with a leading zero and x 0b # expressed in binary with a leading zero and b $number = 255 # assigned to a variable 2. Create a Perl program that outputs each of these literals, one per line. In other words, turn the lines above into legal Perl print statements that output the value of the literal. Of course, this means making each of the values above an argument to a print statement, adding a \n character to each so that the values are printed one per line, and putting a semicolon at the end of each line (You can ignore the comments above.) Call and save the program using the name nums.pl. Select New and Text Document from the File menu. 3. You have also read that Perl includes an assortment of operators for numeric processing. Create a program that calculates the circumference of a circle given the radius as a variable. Call and save this program as circum.pl. Format the output so that the answer is readable. Figure 5 illustrates an example format. (Recall that string literals may be enclosed in double quotes.) Figure 5: Formatting the answer so that it is more readable. HINTS: Create a constant $PI for the calculation, i.e., The variable $radius may be assigned different values for different results. You can make your program more flexible if you format the first output line so that it prints The circumference of a circle with a radius of first and then - 5-

6 the value of $radius followed by the string is. NOTE: The use of blanks in these strings for proper spacing in the output. This version allows you to reuse the program for testing different values by just changing the assignment to $radius. 4. After you have tested it and it is executing properly, try testing your program with this value for $radius 5.0 What happens? 5. The problem, of course, is that negative values for the radius make no sense. We can fix this by screening the input value. Perl supports conditional processing (decision) with the if control structure. Here is the standard format. if (condition) { statement block; } else { statement block; } where condition = some expression that is either true or false, e.g., a comparison, logical operation, etc. where statement block = one or more statements. The brackets are necessary to separate the different parts of the control structure. Although they do not have to be formatted exactly this way with indenting and all it is customary to do so. 6. Create a new version, called circum2.pl that fixes the problem by printing out legitimate results and an error message when the $radius is negative. Test your program with several values to be sure that it is working properly. IV. ACTIVITY: Working With Strings 1. Perl permits string or text literals in two forms using either single or double quotes. For example, we could write rosalita or rosalita Perl interprets these as the same string of characters only two ways to express it. (This is similar to numeric literals such as 255 and ) There is one circumstance in which the formats differ. Consider these instances. rosalita\n or rosalita\n 2. Create a Perl program that outputs these values and compare the results. Call it rosalita.pl. What is the difference between the two versions? - 6-

7 3. The period operator can be used to concatenate strings for assignments. For example, $word = Stop ; $halt = $word.! ; will produce Stop! Try this short program and observe the results. #! usr/bin/perl # concat.pl $one = "The"; $two = "sun"; $three = "also"; $four = "rises"; print $one, $two, $three, $four; Save the program as concat.pl. The output, of course, has no whitespace. We could use a string literal (i.e, single quotes enclosing a space) for a blank. Try fixing the program by assigning a blank to another variable. Now, modify the print statement using the period operator (as shown in Chapter 2). 4. Perl has a variety of string processing functions. A function differs from an operator in that it requires 0 or more arguments values specified in parentheses after the function name. Arguments are indicated in italics. Any value, variable, or expression that satisfies that type can be substituted for that argument. When the function has multiple arguments, they must be cited in that order (and separated by commas). Here are several functions. the length() function. length(string) returns the number of characters in its argument string. example: length( The cat is on the mat. ) would return a value of 22. the index() function. index(string, substring) returns the starting position of the substring in the supplied string. example: index( The cat is on the mat., the mat. ) would return a value of X. the substring() function. substr(string, start_index, length) returns length number of characters from string starting at start_index position. example: substr( Larry Wall, 6, 4) would return a value of Wall. Create a program that assigns the following variables, $sentence = The cat is on the mat. ; $name = Larry Wall ; - 7-

8 Using at least one of the string functions above in each print statement, create a program whose output is similar to that in Figure 6. Figure 6: The output from strings.pl. Save the program as strings.pl. It is a good idea to build this program incrementally, i.e., one print line at a time. Once you get the correct results, then move on to the succeeding output line. (This completes the lab s activities.) V. Submitting Assignments. 1. For labs like this one, you will create a submission folder (as directed above) and upload it to csc105infolder on your Box account. 2. As mentioned earlier, it is also a good idea to save a copy for you. (Use the CS Dept. flash drive that you received earlier.) 3. You can access your Box account by entering the following URL (address) in your browser The entry page will appear. Press Continue to reveal the login page. 4. To log into your account, enter your network username and password as prompted. 5. If you have accepted my invitation to collaborate, you should see two folders csc105 (this folder contains class and lab materials that you can view and download) csc105infolder (this folder is used to submit your assignments) To submit an assignment, open the csc105infolder and drag and drop your submission folder into the box signified. NOTE: Different browsers handle this operation differently, so the results may differ. Consult with the instructor or lab aide for further instructions. Once your browser is set properly, you should not have to perform these settings again. 6. We will use this procedure for most of our lab assignments. So be sure that you are comfortable with it. Future lab activities will assume that you know how to fetch and submit items to our class volume. (These directions will not be repeated.) - 8-

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG 1 Notice Reading Assignment Chapter 1: Introduction to Java Programming Homework 1 It is due this coming Sunday

More information

Typescript on LLVM Language Reference Manual

Typescript on LLVM Language Reference Manual Typescript on LLVM Language Reference Manual Ratheet Pandya UNI: rp2707 COMS 4115 H01 (CVN) 1. Introduction 2. Lexical Conventions 2.1 Tokens 2.2 Comments 2.3 Identifiers 2.4 Reserved Keywords 2.5 String

More information

Linux Tutorial #1. Introduction. Login to a remote Linux machine. Using vim to create and edit C++ programs

Linux Tutorial #1. Introduction. Login to a remote Linux machine. Using vim to create and edit C++ programs Linux Tutorial #1 Introduction The Linux operating system is now over 20 years old, and is widely used in industry and universities because it is fast, flexible and free. Because Linux is open source,

More information

(Refer Slide Time: 01:12)

(Refer Slide Time: 01:12) Internet Technology Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture No #22 PERL Part II We continue with our discussion on the Perl

More information

The CartIt Commerce System Installation Guide

The CartIt Commerce System Installation Guide The CartIt Commerce System Installation Guide On Windows Operating Systems Version 8.0 February 3, 2003 Copyright 2001 CartIt Corporation. All Rights Reserved. Page 1 of 10 THE CART IT COMMERCE SYSTEM

More information

Lab 1 Introduction to UNIX and C

Lab 1 Introduction to UNIX and C Name: Lab 1 Introduction to UNIX and C This first lab is meant to be an introduction to computer environments we will be using this term. You must have a Pitt username to complete this lab. NOTE: Text

More information

IPCoreL. Phillip Duane Douglas, Jr. 11/3/2010

IPCoreL. Phillip Duane Douglas, Jr. 11/3/2010 IPCoreL Programming Language Reference Manual Phillip Duane Douglas, Jr. 11/3/2010 The IPCoreL Programming Language Reference Manual provides concise information about the grammar, syntax, semantics, and

More information

Microsoft Excel Level 2

Microsoft Excel Level 2 Microsoft Excel Level 2 Table of Contents Chapter 1 Working with Excel Templates... 5 What is a Template?... 5 I. Opening a Template... 5 II. Using a Template... 5 III. Creating a Template... 6 Chapter

More information

PERL Bioinformatics. Nicholas E. Navin, Ph.D. Department of Genetics Department of Bioinformatics. TA: Dr. Yong Wang

PERL Bioinformatics. Nicholas E. Navin, Ph.D. Department of Genetics Department of Bioinformatics. TA: Dr. Yong Wang PERL Bioinformatics Nicholas E. Navin, Ph.D. Department of Genetics Department of Bioinformatics TA: Dr. Yong Wang UNIX Background and History PERL Practical Extraction and Reporting Language Developed

More information

COMP284 Practical 1 Perl (1)

COMP284 Practical 1 Perl (1) Introduction COMP284 Practical 1 Perl (1) This practical is dedicated to Perl Programming. While you work through the exercises below compare your results with those of your fellow students and ask for

More information

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I BASIC COMPUTATION x public static void main(string [] args) Fundamentals of Computer Science I Outline Using Eclipse Data Types Variables Primitive and Class Data Types Expressions Declaration Assignment

More information

Introduction to Java Applications

Introduction to Java Applications 2 Introduction to Java Applications OBJECTIVES In this chapter you will learn: To write simple Java applications. To use input and output statements. Java s primitive types. Basic memory concepts. To use

More information

S206E Lecture 19, 5/24/2016, Python an overview

S206E Lecture 19, 5/24/2016, Python an overview S206E057 Spring 2016 Copyright 2016, Chiu-Shui Chan. All Rights Reserved. Global and local variables: differences between the two Global variable is usually declared at the start of the program, their

More information

Scripting Languages. Diana Trandabăț

Scripting Languages. Diana Trandabăț Scripting Languages Diana Trandabăț Master in Computational Linguistics - 1 st year 2017-2018 Today s lecture What is Perl? How to install Perl? How to write Perl progams? How to run a Perl program? perl

More information

Have examined process Creating program Have developed program Written in C Source code

Have examined process Creating program Have developed program Written in C Source code Preprocessing, Compiling, Assembling, and Linking Introduction In this lesson will examine Architecture of C program Introduce C preprocessor and preprocessor directives How to use preprocessor s directives

More information

PHP and MySQL for Dynamic Web Sites. Intro Ed Crowley

PHP and MySQL for Dynamic Web Sites. Intro Ed Crowley PHP and MySQL for Dynamic Web Sites Intro Ed Crowley Class Preparation If you haven t already, download the sample scripts from: http://www.larryullman.com/books/phpand-mysql-for-dynamic-web-sitesvisual-quickpro-guide-4thedition/#downloads

More information

BLM2031 Structured Programming. Zeyneb KURT

BLM2031 Structured Programming. Zeyneb KURT BLM2031 Structured Programming Zeyneb KURT 1 Contact Contact info office : D-219 e-mail zeynebkurt@gmail.com, zeyneb@ce.yildiz.edu.tr When to contact e-mail first, take an appointment What to expect help

More information

CS 220: Introduction to Parallel Computing. Beginning C. Lecture 2

CS 220: Introduction to Parallel Computing. Beginning C. Lecture 2 CS 220: Introduction to Parallel Computing Beginning C Lecture 2 Today s Schedule More C Background Differences: C vs Java/Python The C Compiler HW0 8/25/17 CS 220: Parallel Computing 2 Today s Schedule

More information

Website Development Komodo Editor and HTML Intro

Website Development Komodo Editor and HTML Intro Website Development Komodo Editor and HTML Intro Introduction In this Lecture and Tour we will cover: o Use of the editor that will be used for the Website Development and Javascript Programming sections

More information

Section 2: Introduction to Java. Historical note

Section 2: Introduction to Java. Historical note The only way to learn a new programming language is by writing programs in it. - B. Kernighan & D. Ritchie Section 2: Introduction to Java Objectives: Data Types Characters and Strings Operators and Precedence

More information

Lab 2 Building on Linux

Lab 2 Building on Linux Lab 2 Building on Linux Assignment Details Assigned: January 28 th, 2013. Due: January 30 th, 2013 at midnight. Background This assignment should introduce the basic development tools on Linux. This assumes

More information

CSE 101 Introduction to Computers Development / Tutorial / Lab Environment Setup

CSE 101 Introduction to Computers Development / Tutorial / Lab Environment Setup CSE 101 Introduction to Computers Development / Tutorial / Lab Environment Setup Purpose: The purpose of this lab is to setup software that you will be using throughout the term for learning about Python

More information

CS 2400 Laboratory Assignment #1: Exercises in Compilation and the UNIX Programming Environment (100 pts.)

CS 2400 Laboratory Assignment #1: Exercises in Compilation and the UNIX Programming Environment (100 pts.) 1 Introduction 1 CS 2400 Laboratory Assignment #1: Exercises in Compilation and the UNIX Programming Environment (100 pts.) This laboratory is intended to give you some brief experience using the editing/compiling/file

More information

Cmpt 101 Lab 1 - Outline

Cmpt 101 Lab 1 - Outline Cmpt 101 Lab 1 - Outline Instructions: Work through this outline completely once directed to by your Lab Instructor and fill in the Lab 1 Worksheet as indicated. Contents PART 1: GETTING STARTED... 2 PART

More information

My First Command-Line Program

My First Command-Line Program 1. Tutorial Overview My First Command-Line Program In this tutorial, you re going to create a very simple command-line application that runs in a window. Unlike a graphical user interface application where

More information

Chapter 2 Basic Elements of C++

Chapter 2 Basic Elements of C++ C++ Programming: From Problem Analysis to Program Design, Fifth Edition 2-1 Chapter 2 Basic Elements of C++ At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class Discussion

More information

Computers and Computation. The Modern Computer. The Operating System. The Operating System

Computers and Computation. The Modern Computer. The Operating System. The Operating System The Modern Computer Computers and Computation What is a computer? A machine that manipulates data according to instructions. Despite their apparent complexity, at the lowest level computers perform simple

More information

Perl and Python ESA 2007/2008. Eelco Schatborn 27 September 2007

Perl and Python ESA 2007/2008. Eelco Schatborn 27 September 2007 Perl and Python ESA 2007/2008 Eelco Schatborn eelco@os3.nl 27 September 2007 ESA: Perl Vandaag: 1. Perl introduction 2. Basic Perl: types, variables, statements,... 3. Object Oriented Perl 4. Documentation

More information

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming Intro to Programming Unit 7 Intro to Programming 1 What is Programming? 1. Programming Languages 2. Markup vs. Programming 1. Introduction 2. Print Statement 3. Strings 4. Types and Values 5. Math Externals

More information

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

More information

Full file at

Full file at Java Programming: From Problem Analysis to Program Design, 3 rd Edition 2-1 Chapter 2 Basic Elements of Java At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class

More information

Chapter 2. Lexical Elements & Operators

Chapter 2. Lexical Elements & Operators Chapter 2. Lexical Elements & Operators Byoung-Tak Zhang TA: Hanock Kwak Biointelligence Laboratory School of Computer Science and Engineering Seoul National Univertisy http://bi.snu.ac.kr The C System

More information

Introduction to Perl. c Sanjiv K. Bhatia. Department of Mathematics & Computer Science University of Missouri St. Louis St.

Introduction to Perl. c Sanjiv K. Bhatia. Department of Mathematics & Computer Science University of Missouri St. Louis St. Introduction to Perl c Sanjiv K. Bhatia Department of Mathematics & Computer Science University of Missouri St. Louis St. Louis, MO 63121 Contents 1 Introduction 1 2 Getting started 1 3 Writing Perl scripts

More information

There are two ways to use the python interpreter: interactive mode and script mode. (a) open a terminal shell (terminal emulator in Applications Menu)

There are two ways to use the python interpreter: interactive mode and script mode. (a) open a terminal shell (terminal emulator in Applications Menu) I. INTERACTIVE MODE VERSUS SCRIPT MODE There are two ways to use the python interpreter: interactive mode and script mode. 1. Interactive Mode (a) open a terminal shell (terminal emulator in Applications

More information

CSCI 4152/6509 Natural Language Processing Lecture 6: Regular Expressions; Text Processing in Perl

CSCI 4152/6509 Natural Language Processing Lecture 6: Regular Expressions; Text Processing in Perl Lecture 6 p.1 Faculty of Computer Science, Dalhousie University CSCI 4152/6509 Natural Language Processing Lecture 6: Regular Expressions; Text Processing in Perl 18-Jan-2019 Location: LSC Psychology P5260

More information

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath UNIT - I Introduction to C Programming Introduction to C C was originally developed in the year 1970s by Dennis Ritchie at Bell Laboratories, Inc. C is a general-purpose programming language. It has been

More information

Physics 306 Computing Lab 1: Hello, World!

Physics 306 Computing Lab 1: Hello, World! 1. Introduction Physics 306 Computing Lab 1: Hello, World! In today s lab, you will learn how to write simple programs, to compile them, and to run them. You will learn about input and output, variables,

More information

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG 1 Notice Class Website http://www.cs.umb.edu/~jane/cs114/ Reading Assignment Chapter 1: Introduction to Java Programming

More information

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines.

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines. Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

More information

fpp: Fortran preprocessor March 9, 2009

fpp: Fortran preprocessor March 9, 2009 fpp: Fortran preprocessor March 9, 2009 1 Name fpp the Fortran language preprocessor for the NAG Fortran compiler. 2 Usage fpp [option]... [input-file [output-file]] 3 Description fpp is the preprocessor

More information

Getting Started with Python and the PyCharm IDE

Getting Started with Python and the PyCharm IDE New York University School of Continuing and Professional Studies Division of Programs in Information Technology Getting Started with Python and the PyCharm IDE Please note that if you already know how

More information

EL2310 Scientific Programming

EL2310 Scientific Programming (yaseminb@kth.se) Overview Overview Roots of C Getting started with C Closer look at Hello World Programming Environment Discussion Basic Datatypes and printf Schedule Introduction to C - main part of

More information

CSCI 161: Introduction to Programming I Lab 1b: Hello, World (Eclipse, Java)

CSCI 161: Introduction to Programming I Lab 1b: Hello, World (Eclipse, Java) Goals - to learn how to compile and execute a Java program - to modify a program to enhance it Overview This activity will introduce you to the Java programming language. You will type in the Java program

More information

UNIT- 3 Introduction to C++

UNIT- 3 Introduction to C++ UNIT- 3 Introduction to C++ C++ Character Sets: Letters A-Z, a-z Digits 0-9 Special Symbols Space + - * / ^ \ ( ) [ ] =!= . $, ; : %! &? _ # = @ White Spaces Blank spaces, horizontal tab, carriage

More information

IRONKEY D300S SECURE USB 3.0 FLASH DRIVE

IRONKEY D300S SECURE USB 3.0 FLASH DRIVE IRONKEY D300S SECURE USB 3.0 FLASH DRIVE User Guide Document No. 48000130-001.A01 D300S Page 1 of 27 Table of Contents About This Manual... 3 System Requirements...3 Recommendations...3 Setup (Windows

More information

A Fast Review of C Essentials Part I

A Fast Review of C Essentials Part I A Fast Review of C Essentials Part I Structural Programming by Z. Cihan TAYSI Outline Program development C Essentials Functions Variables & constants Names Formatting Comments Preprocessor Data types

More information

CSI Lab 02. Tuesday, January 21st

CSI Lab 02. Tuesday, January 21st CSI Lab 02 Tuesday, January 21st Objectives: Explore some basic functionality of python Introduction Last week we talked about the fact that a computer is, among other things, a tool to perform high speed

More information

Introduction to C CMSC 104 Spring 2014, Section 02, Lecture 6 Jason Tang

Introduction to C CMSC 104 Spring 2014, Section 02, Lecture 6 Jason Tang Introduction to C CMSC 104 Spring 2014, Section 02, Lecture 6 Jason Tang Topics History of Programming Languages Compilation Process Anatomy of C CMSC 104 Coding Standards Machine Code In the beginning,

More information

Room 3P16 Telephone: extension ~irjohnson/uqc146s1.html

Room 3P16 Telephone: extension ~irjohnson/uqc146s1.html UQC146S1 Introductory Image Processing in C Ian Johnson Room 3P16 Telephone: extension 3167 Email: Ian.Johnson@uwe.ac.uk http://www.csm.uwe.ac.uk/ ~irjohnson/uqc146s1.html Ian Johnson 1 UQC146S1 What is

More information

Indian Institute of Technology Kharagpur. PERL Part II. Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. I.I.T.

Indian Institute of Technology Kharagpur. PERL Part II. Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. I.I.T. Indian Institute of Technology Kharagpur PERL Part II Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. I.I.T. Kharagpur, INDIA Lecture 22: PERL Part II On completion, the student will be able

More information

Laboratory 5: Implementing Loops and Loop Control Strategies

Laboratory 5: Implementing Loops and Loop Control Strategies Laboratory 5: Implementing Loops and Loop Control Strategies Overview: Objectives: C++ has three control structures that are designed exclusively for iteration: the while, for and do statements. In today's

More information

CS2900 Introductory Programming with Python and C++ Kevin Squire LtCol Joel Young Fall 2007

CS2900 Introductory Programming with Python and C++ Kevin Squire LtCol Joel Young Fall 2007 CS2900 Introductory Programming with Python and C++ Kevin Squire LtCol Joel Young Fall 2007 Course Web Site http://www.nps.navy.mil/cs/facultypages/squire/cs2900 All course related materials will be posted

More information

Part III Appendices 165

Part III Appendices 165 Part III Appendices 165 Appendix A Technical Instructions Learning Outcomes This material will help you learn how to use the software you need to do your work in this course. You won t be tested on it.

More information

Lab # 2. For today s lab:

Lab # 2. For today s lab: 1 ITI 1120 Lab # 2 Contributors: G. Arbez, M. Eid, D. Inkpen, A. Williams, D. Amyot 1 For today s lab: Go the course webpage Follow the links to the lab notes for Lab 2. Save all the java programs you

More information

1) Log on to the computer using your PU net ID and password.

1) Log on to the computer using your PU net ID and password. CS 150 Lab Logging on: 1) Log on to the computer using your PU net ID and password. Connecting to Winter: Winter is the computer science server where all your work will be stored. Remember, after you log

More information

CS 177 Recitation. Week 1 Intro to Java

CS 177 Recitation. Week 1 Intro to Java CS 177 Recitation Week 1 Intro to Java Questions? Computers Computers can do really complex stuff. How? By manipulating data according to lists of instructions. Fundamentally, this is all that a computer

More information

Lab: Supplying Inputs to Programs

Lab: Supplying Inputs to Programs Steven Zeil May 25, 2013 Contents 1 Running the Program 2 2 Supplying Standard Input 4 3 Command Line Parameters 4 1 In this lab, we will look at some of the different ways that basic I/O information can

More information

Pathologically Eclectic Rubbish Lister

Pathologically Eclectic Rubbish Lister Pathologically Eclectic Rubbish Lister 1 Perl Design Philosophy Author: Reuben Francis Cornel perl is an acronym for Practical Extraction and Report Language. But I guess the title is a rough translation

More information

JME Language Reference Manual

JME Language Reference Manual JME Language Reference Manual 1 Introduction JME (pronounced jay+me) is a lightweight language that allows programmers to easily perform statistic computations on tabular data as part of data analysis.

More information

Overview. - General Data Types - Categories of Words. - Define Before Use. - The Three S s. - End of Statement - My First Program

Overview. - General Data Types - Categories of Words. - Define Before Use. - The Three S s. - End of Statement - My First Program Overview - General Data Types - Categories of Words - The Three S s - Define Before Use - End of Statement - My First Program a description of data, defining a set of valid values and operations List of

More information

Student Guide. Document Version: This guide documents features available in NETLAB+ VE version and later.

Student Guide. Document Version: This guide documents features available in NETLAB+ VE version and later. Student Guide Document Version: 2018-02-15 This guide documents features available in NETLAB+ VE version 18.1.0 and later. Copyright 2018 Network Development Group, Inc. www.netdevgroup.com NETLAB Academy

More information

Laboratory Assignment #3 Eclipse CDT

Laboratory Assignment #3 Eclipse CDT Lab 3 September 12, 2010 CS-2303, System Programming Concepts, A-term 2012 Objective Laboratory Assignment #3 Eclipse CDT Due: at 11:59 pm on the day of your lab session To learn to learn to use the Eclipse

More information

SECTION 1: INTRODUCTION. ENGR 112 Introduction to Engineering Computing

SECTION 1: INTRODUCTION. ENGR 112 Introduction to Engineering Computing SECTION 1: INTRODUCTION ENGR 112 Introduction to Engineering Computing 2 Course Overview What is Programming? 3 Programming The implementation of algorithms in a particular computer programming language

More information

Semester 2, 2018: Lab 1

Semester 2, 2018: Lab 1 Semester 2, 2018: Lab 1 S2 2018 Lab 1 This lab has two parts. Part A is intended to help you familiarise yourself with the computing environment found on the CSIT lab computers which you will be using

More information

CS 1110 SPRING 2016: GETTING STARTED (Jan 27-28) First Name: Last Name: NetID:

CS 1110 SPRING 2016: GETTING STARTED (Jan 27-28)   First Name: Last Name: NetID: CS 1110 SPRING 2016: GETTING STARTED (Jan 27-28) http://www.cs.cornell.edu/courses/cs1110/2016sp/labs/lab01/lab01.pdf First Name: Last Name: NetID: Goals. Learning a computer language is a lot like learning

More information

Exploring UNIX: Session 3

Exploring UNIX: Session 3 Exploring UNIX: Session 3 UNIX file system permissions UNIX is a multi user operating system. This means several users can be logged in simultaneously. For obvious reasons UNIX makes sure users cannot

More information

CpSc 1111 Lab 4 Part a Flow Control, Branching, and Formatting

CpSc 1111 Lab 4 Part a Flow Control, Branching, and Formatting CpSc 1111 Lab 4 Part a Flow Control, Branching, and Formatting Your factors.c and multtable.c files are due by Wednesday, 11:59 pm, to be submitted on the SoC handin page at http://handin.cs.clemson.edu.

More information

Lecture 3. Input, Output and Data Types

Lecture 3. Input, Output and Data Types Lecture 3 Input, Output and Data Types Goals for today Variable Types Integers, Floating-Point, Strings, Booleans Conversion between types Operations on types Input/Output Some ways of getting input, and

More information

Embedding SoftChalk In Blackboard. SoftChalk Create 9

Embedding SoftChalk In Blackboard. SoftChalk Create 9 Embedding SoftChalk In Blackboard SoftChalk Create 9 Revision Date: September 8, 2015 Table of Contents SOFTCHALK CLOUD... 1 ACQUIRE A CLOUD ACCOUNT... 1 CREATE FOLDERS IN YOUR SOFTCHALK CLOUD ACCOUNT...

More information

8. Control statements

8. Control statements 8. Control statements A simple C++ statement is each of the individual instructions of a program, like the variable declarations and expressions seen in previous sections. They always end with a semicolon

More information

2 Getting Started. Getting Started (v1.8.6) 3/5/2007

2 Getting Started. Getting Started (v1.8.6) 3/5/2007 2 Getting Started Java will be used in the examples in this section; however, the information applies to all supported languages for which you have installed a compiler (e.g., Ada, C, C++, Java) unless

More information

CPSC 150 Laboratory Manual. Lab 1 Introduction to Program Creation

CPSC 150 Laboratory Manual. Lab 1 Introduction to Program Creation CPSC 150 Laboratory Manual A Practical Approach to Java, jedit & WebCAT Department of Physics, Computer Science & Engineering Christopher Newport University Lab 1 Introduction to Program Creation Welcome

More information

Language Reference Manual

Language Reference Manual TAPE: A File Handling Language Language Reference Manual Tianhua Fang (tf2377) Alexander Sato (as4628) Priscilla Wang (pyw2102) Edwin Chan (cc3919) Programming Languages and Translators COMSW 4115 Fall

More information

CSCI 4152/6509 Natural Language Processing. Perl Tutorial CSCI 4152/6509. CSCI 4152/6509, Perl Tutorial 1

CSCI 4152/6509 Natural Language Processing. Perl Tutorial CSCI 4152/6509. CSCI 4152/6509, Perl Tutorial 1 CSCI 4152/6509 Natural Language Processing Perl Tutorial CSCI 4152/6509 Vlado Kešelj CSCI 4152/6509, Perl Tutorial 1 created in 1987 by Larry Wall About Perl interpreted language, with just-in-time semi-compilation

More information

Function. Description

Function. Description Function Check In Get / Checkout Description Checking in a file uploads the file from the user s hard drive into the vault and creates a new file version with any changes to the file that have been saved.

More information

Chapter 2. Editing And Compiling

Chapter 2. Editing And Compiling Chapter 2. Editing And Compiling Now that the main concepts of programming have been explained, it's time to actually do some programming. In order for you to "edit" and "compile" a program, you'll need

More information

CSCI 4152/6509 Natural Language Processing. Lab 1: FCS Computing Environment

CSCI 4152/6509 Natural Language Processing. Lab 1: FCS Computing Environment CSCI 4152/6509 Natural Language Processing Lab 1: FCS Computing Environment http://web.cs.dal.ca/ vlado/csci6509 Lab Instructor: Dijana Kosmajac, Dhivya Jayaraman Slides copyright: Mike McAllister, Vlado

More information

:

: CS200 Assignment 5 HTML and CSS Due Monday February 11th 2019, 11:59 pm Readings and Resources On the web: http://validator.w3.org/ : a site that will check a web page for faulty HTML tags http://jigsaw.w3.org/css-validator/

More information

Java Bytecode (binary file)

Java Bytecode (binary file) Java is Compiled Unlike Python, which is an interpreted langauge, Java code is compiled. In Java, a compiler reads in a Java source file (the code that we write), and it translates that code into bytecode.

More information

1.1 Introduction to C Language. Department of CSE

1.1 Introduction to C Language. Department of CSE 1.1 Introduction to C Language 1 Department of CSE Objectives To understand the structure of a C-Language Program To write a minimal C program To introduce the include preprocessor command To be able to

More information

MP 3 A Lexer for MiniJava

MP 3 A Lexer for MiniJava MP 3 A Lexer for MiniJava CS 421 Spring 2012 Revision 1.0 Assigned Wednesday, February 1, 2012 Due Tuesday, February 7, at 09:30 Extension 48 hours (penalty 20% of total points possible) Total points 43

More information

Programming in Python 3

Programming in Python 3 Programming in Python 3 Programming transforms your computer from a home appliance to a power tool Al Sweigart, The invent with Python Blog Programming Introduction Write programs that solve a problem

More information

CS 6353 Compiler Construction Project Assignments

CS 6353 Compiler Construction Project Assignments CS 6353 Compiler Construction Project Assignments In this project, you need to implement a compiler for a language defined in this handout. The programming language you need to use is C or C++ (and the

More information

12.1 UNDERSTANDING UNIX SHELL PROGRAMMING LANGUAGE: AN INTRODUCTION Writing a Simple Script Executing a Script

12.1 UNDERSTANDING UNIX SHELL PROGRAMMING LANGUAGE: AN INTRODUCTION Writing a Simple Script Executing a Script 12 Shell Programming This chapter concentrates on shell programming. It explains the capabilities of the shell as an interpretive high-level language. It describes shell programming constructs and particulars.

More information

CS1110 Lab 1 (Jan 27-28, 2015)

CS1110 Lab 1 (Jan 27-28, 2015) CS1110 Lab 1 (Jan 27-28, 2015) First Name: Last Name: NetID: Completing this lab assignment is very important and you must have a CS 1110 course consultant tell CMS that you did the work. (Correctness

More information

Using Blackboard Drive to upload/manage content in Blackboard Learn

Using Blackboard Drive to upload/manage content in Blackboard Learn Using Blackboard Drive to upload/manage content in Blackboard Learn Downloading and Installing Blackboard Drive 1. Login to Blackboard Learn, and click on the Utilities Tab. 2. Locate the Blackboard Drive

More information

What did we talk about last time? Examples switch statements

What did we talk about last time? Examples switch statements Week 4 - Friday What did we talk about last time? Examples switch statements History of computers Hardware Software development Basic Java syntax Output with System.out.print() Mechanical Calculation

More information

MATLAB Project: Getting Started with MATLAB

MATLAB Project: Getting Started with MATLAB Name Purpose: To learn to create matrices and use various MATLAB commands for reference later MATLAB built-in functions used: [ ] : ; + - * ^, size, help, format, eye, zeros, ones, diag, rand, round, cos,

More information

JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1)

JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1) Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 1 Professional Program: Data Administration and Management JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1) WHO

More information

Teacher Activity: page 1/9 Mathematical Expressions in Microsoft Word

Teacher Activity: page 1/9 Mathematical Expressions in Microsoft Word Teacher Activity: page 1/9 Mathematical Expressions in Microsoft Word These instructions assume that you are familiar with using MS Word for ordinary word processing *. If you are not comfortable entering

More information

12/22/11. Java How to Program, 9/e. Help you get started with Eclipse and NetBeans integrated development environments.

12/22/11. Java How to Program, 9/e. Help you get started with Eclipse and NetBeans integrated development environments. Java How to Program, 9/e Education, Inc. All Rights Reserved. } Java application programming } Use tools from the JDK to compile and run programs. } Videos at www.deitel.com/books/jhtp9/ Help you get started

More information

Barchard Introduction to SPSS Marks

Barchard Introduction to SPSS Marks Barchard Introduction to SPSS 21.0 3 Marks Purpose The purpose of this assignment is to introduce you to SPSS, the most commonly used statistical package in the social sciences. You will create a new data

More information

introduction week 1 Ritsumeikan University College of Information Science and Engineering Ian Piumarta 1 / 20 imperative programming about the course

introduction week 1 Ritsumeikan University College of Information Science and Engineering Ian Piumarta 1 / 20 imperative programming about the course week 1 introduction Ritsumeikan University College of Information Science and Engineering Ian Piumarta 1 / 20 class format 30 minutes (give or take a few) presentation 60 minutes (give or take a few) practice

More information

Chapter 2, Part I Introduction to C Programming

Chapter 2, Part I Introduction to C Programming Chapter 2, Part I Introduction to C Programming C How to Program, 8/e, GE 2016 Pearson Education, Ltd. All rights reserved. 1 2016 Pearson Education, Ltd. All rights reserved. 2 2016 Pearson Education,

More information

Computer Science Lab Exercise 1

Computer Science Lab Exercise 1 1 of 10 Computer Science 127 - Lab Exercise 1 Introduction to Excel User-Defined Functions (pdf) During this lab you will experiment with creating Excel user-defined functions (UDFs). Background We use

More information

Copyright. Trademarks Attachmate Corporation. All rights reserved. USA Patents Pending. WRQ ReflectionVisual Basic User Guide

Copyright. Trademarks Attachmate Corporation. All rights reserved. USA Patents Pending. WRQ ReflectionVisual Basic User Guide PROGRAMMING WITH REFLECTION: VISUAL BASIC USER GUIDE WINDOWS XP WINDOWS 2000 WINDOWS SERVER 2003 WINDOWS 2000 SERVER WINDOWS TERMINAL SERVER CITRIX METAFRAME CITRIX METRAFRAME XP ENGLISH Copyright 1994-2006

More information

The e switch allows Perl to execute Perl statements at the command line instead of from a script.

The e switch allows Perl to execute Perl statements at the command line instead of from a script. CH02.DOC Page 5 Friday, January 26, 2001 2:35 PM 2 Perl Scripts 2.1 Perl at the Command Line Although most of your work with Perl will be done in scripts, Perl can also be executed at the command line

More information

CS Introduction to Computational and Data Science. Instructor: Renzhi Cao Computer Science Department Pacific Lutheran University Spring 2017

CS Introduction to Computational and Data Science. Instructor: Renzhi Cao Computer Science Department Pacific Lutheran University Spring 2017 CS 133 - Introduction to Computational and Data Science Instructor: Renzhi Cao Computer Science Department Pacific Lutheran University Spring 2017 Previous class We have learned the path and file system.

More information

12 MEL. Getting Started with Maya 631

12 MEL. Getting Started with Maya 631 12 MEL MEL (Maya Embedded Language) is a powerful command and scripting language that gives you direct control over Maya's features, processes, and workflow. Maya s user interface is built using MEL scripts

More information

Table of Contents EVALUATION COPY

Table of Contents EVALUATION COPY Table of Contents Introduction... 1-2 A Brief History of Python... 1-3 Python Versions... 1-4 Installing Python... 1-5 Environment Variables... 1-6 Executing Python from the Command Line... 1-7 IDLE...

More information