Carleton University Department of Systems and Computer Engineering SYSC Foundations of Imperative Programming - Winter 2012

Similar documents
Carleton University Department of Systems and Computer Engineering SYSC Foundations of Imperative Programming - Winter 2012

Carleton University Department of Systems and Computer Engineering SYSC Foundations of Imperative Programming - Winter Lab 8 - Structures

Carleton University Department of Systems and Computer Engineering SYSC Foundations of Imperative Programming - Winter 2012

Carleton University Department of Systems and Computer Engineering SYSC Foundations of Imperative Programming - Winter 2012

Lab 1: Introduction to C Programming. (Creating a program using the Microsoft developer Studio, Compiling and Linking)

CS 209 Section 52 Lab 1-A: Getting Started with NetBeans Instructor: J.G. Neal Objectives: Lab Instructions: Log in Create folder CS209

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

Update Service for EASY-SOFT

Introduction. Key features and lab exercises to familiarize new users to the Visual environment

Getting Started with Visual Studio

Manage Files. Accessing Manage Files

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2003

Using the Dev C++ Compiler to Create a Program

MS Visual Studio.Net 2008 Tutorial

Downloading & Installing Audacity

RVDS 3.0 Introductory Tutorial

Lab 1 Introduction to UNIX and C

Chapter 2. Basics of Program Writing

A Quick Tour GETTING STARTED WHAT S IN THIS CHAPTER?

Lab #1: A Quick Introduction to the Eclipse IDE

Developing Intelligent Apps

Copyright 2012 Pulse Systems, Inc. Page 1 of 29

Accessing Web Version of Life Illustrator

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2005

Creating Projects using Microsoft Visual Studio 2017

CSE 351. Introduction & Course Tools

Lab Objectives. 2. Preparations. 3. Signing in. 4. Examining the Host Environment. 5. Part A: Introduction to AVR Studio. 5.

Installing and Running the Google App Engine On a Macintosh System

INSTRUCTIONS FOR SETTING UP ROACH SOFTWARE IN MPLAB-X

Outlook tips for road warriors

Lab 4: Introduction to Programming

Assembly Language Lab # 1

CST8152 Compilers Creating a C Language Console Project with Microsoft Visual Studio.Net 2010

RVDS 4.0 Introductory Tutorial

Installing and Using Dev-C++

User Manual. Backup Utility for MiniStation MiniStation. v 2.0

Workshare Professional 10. Getting Started Guide

CipherLab Workstation Setup (Windows 7/8/10)

Intermediate Programming, Spring Misha Kazhdan

Getting started with UNIX/Linux for G51PRG and G51CSA

Introduction to Computation and Problem Solving

Handouts for Lecture 1

Assignment Submission HOWTO

COMP s1 Lecture 1

Tutorial: How to Load a UI Canvas from Lua

CS 3330 Introduction. Daniel and Charles. CS 3330 Computer Architecture 1

Lab: Supplying Inputs to Programs

S8352: Java From the Very Beginning Part I - Exercises

Tutorial - Getting Started with Embedded Software. Embedded Software Tools. Modified by Admin on Nov 6, 2013

CMPT 115. C tutorial for students who took 111 in Java. University of Saskatchewan. Mark G. Eramian, Ian McQuillan CMPT 115 1/32

Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 2

CS Basics 15) Compiling a C prog.

Engr 123 Spring 2018 Notes on Visual Studio

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

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

What is Eclipse? A free copy can be downloaded at:

You have a PC with a USB interface, running Microsoft Windows XP (SP2 or greater) or Vista You have the Workshop Installation Software Flash Drive

TREX Set-Up Guide: Creating a TREX Executable File for Windows

How to Use Audacity to Create MP3s

Beyond this course. Machine code. Readings: CP:AMA 2.1, 15.4

Introduction to Programming. Lecture 2: Introduction to C

Memory Allocation in C

Fairfield University Using Xythos for File Storage

Hello World on the ATLYS Board. Building the Hardware

Map update Instructions

Laboratory Assignment #3 Eclipse CDT

HOW TO USE CODE::BLOCKS IDE FOR COMPUTER PROGRAMMING LABORATORY SESSIONS

Lab Android Development Environment

Hello, World! in C. Johann Myrkraverk Oskarsson October 23, The Quintessential Example Program 1. I Printing Text 2. II The Main Function 3

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

esi-risc Development Suite Getting Started Guide

Web Intelligence Rich Client Getting Started Business Objects 4.1

Manage and Generate Reports

Manual Eclipse CDT Mac OS Snow Leopard

General Guidelines: SAS Analyst

COMP2121 Introductory Experiment

University of Hawaii EE 361L MPLab Quick Tutorial and Project 2.1 Last updated September 1, 2011

JEE2600 INTRODUCTION TO DIGITAL LOGIC AND COMPUTER DESIGN. ModelSim Tutorial. Prepared by: Phil Beck 9/8/2008. Voter Function

Set up your computer to sync your OneDrive for Business files in Office 365

Getting Started with Eclipse/Java

INSTRUCTIONS FOR SETTING UP ROACH SOFTWARE IN MPLAB-X

Imperative and Object Oriented Programming. Tutorial 1. Charlie Abela Department of Artificial Intelligence

AP Computer Science A Summer Assignment

In this exercise, you ll create a netcdf raster layer using the variable tmin. You will change the display by selecting a different time step.

Java applets & the RealJ IDE

2. create the workbook file

PCGENESIS TECHNICAL SYSTEM OPERATIONS GUIDE

Parallel Programming Pre-Assignment. Setting up the Software Environment

You re most likely eager to get started programming in C. I shan t waste

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

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

CS 253: Intro to Systems Programming 1/21

Tutorial - Exporting Models to Simulink

TOP SERVER V5 CLIENT CONNECTIVITY ROCKWELL FACTORYTALK VIEW STUDIO. Table of Contents

Opening and Saving Files using Minitab in Remote Applications using Macintosh

eiconsole for Healthcare Getting Started Tutorial

eiconsole for Healthcare Getting Started Tutorial

Code Composer Studio. MSP Project Setup

CS 261 Fall C Introduction. Variables, Memory Model, Pointers, and Debugging. Mike Lam, Professor

Code::Blocks Student Manual

Transcription:

Carleton University Department of Systems and Computer Engineering SYSC 2006 - Foundations of Imperative Programming - Winter 2012 Lab 1 - Introduction to Pelles C Objective To become familiar with the Pelles C programming environment. Instructions This lab should take no more than half an hour or so, but completing it will ensure that you know how to prepare a C program as a Pelles C project before we have you do some real programming in the next lab. Step 1 Create a folder named Lab 1. Launch Pelles C. You may see a Browse information dialogue box: If this box appears, click the Close button. 1

Pelles C should now look like this: 2

Step 2 You're now going to create a project named hello (because it will contain the classic "Hello, world!" program). From the menu bar, select File > New > Project... A New Project dialog box will appear: The Location: field allows you to browse to the folder where you want to store your project (click the button). For example, on my computer I have a folder named SYSC 2006 that contains a folder named Labs, which in turn contains a folder named Lab 1. On the lab computer, browse to the Lab 1 folder you created n Step 1. After browsing to that folder, type hello in the Name: field. We also need to select the type of project that will be created. Click the icon labelled Win32 Console program (EXE). Do not click Win32 Program (EXE) or any of the other empty project icons. Click the OK button. Pelles C will create a folder named hello inside the Lab 1 folder. The files associated with this project will be stored there. Pelles C should now look like this (notice that the project name, hello, now appears in the righthand column): 3

4

Step 3 From the menu bar, select File > New > Source code. An empty blue editor window will appear: Type this C program in the editor: #include <stdio.h> #include <stdlib.h> int main(void) { printf("hello, world!\n"); exit(0); } This is similar to the "Hello, world!" program that was presented in class, except that instead of executing a return statement to terminate the program, main calls the exit function from C's standard library.the advantage of using exit is that it can be called from anywhere in a program, whereas executing return terminates a program only when it is encountered inside main. 5

Pelles C should now look like this: Step 4 From the menu bar, select File > Save as... (or or click the Save button from the row of icons below the menu bar). A Save As dialogue box will appear. Type the name main in the File name: field, and ensure that Save as type: is Source file (*.c). Click Save. You will now be asked if you want to add the file to the project: 6

Click Yes. Pelles C will save the code in the editor in a file called main.c, and add this file to your project. Pelles C will now look like this: Notice that main.c is now listed as one of the files in the hello project (see the right-hand column). Step 5 From the menu bar, select Project > Build hello.exe (or or click the Build button from the row of icons below the menu bar). Pelles C will compile the code in main.c, and if there are no compilation errors, link the compiled code to the C libraries that the program requires, producing a file called hello.exe file (the executable program). (We will discuss compilation and linking in one of the lectures). 7

Step 6 From the menu bar, select Project > Execute hello.exe (or or click the Execute button from the row of icons below the menu bar). A Console window will appear, showing the program s output: Press any key to close the console window. Step 7 The next thing you ll do is package the project in a ZIP file (compressed folder). From the menu bar, select Project > ZIP Files. A Save As dialog box will appear: Change file name to lab1, then click Save. Pelles C will create a compressed (zipped) folder called lab1.zip, which will contain copies of the the source code and several other files associated with the project. (The original files will not be removed). The compressed folder will be stored in your project folder (i.e., folder hello). 8

Step 8 Call a TA. While the TA watches, edit the program so that it's output will be: Hello, world! C programming is fun! Demonstrate that you can save the edited file, build the project and execute it. Step 9 From the menu bar, select File > Close project, then exit Pelles C. 9