First Day in Lab Making a C++ program

Slides:



Advertisements
Similar presentations
Dayu Zhang 9/8/2014 Lab02. Example of Commands pwd --- show your current directory This is home of venus, not your home directory Tilde: means you are.
Advertisements

1 The Internet Ideas formulated in the early 1960’s. Fundamental work done around Some steps involved: –Creating the network idea. –Creating the.
Scite Scintilla integrated text editor. Click here.
CS1020: Intro Workshop. Topics CS1020Intro Workshop Login to UNIX operating system 2. …………………………………… 3. …………………………………… 4. …………………………………… 5. ……………………………………
Dayu Zhang 9/3/2014 Lab01. Lab Instructor: Dayu Zhang Office Hour Mon/Wed 10:40am – 11:10am Room A201 Lab Website
Course Introduction and Getting Started with C 1 USF - COP C for Engineers Summer 2008.
CS 117 Section 2 + KNET Computer accounts – ed to KNET students –Change password Homework 1 Lab Tutors –In lab for next 2 weeks –Will help you with.
Agenda What is Computer Programming? The Programming Process
CprE 288 – Quick intro for compiling C in Linux
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
CS Tutorial 1 Getting Started with Visual Studio 2012 (Visual Studio 2010 are no longer available on MSDNAA, please choose Visual Studio 2012 which.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
1 N305 C Programming. 2 Objectives for the Lab ä Learn problem solving strategies ä Achieve intermediate knowledge of C Programming Language ä Gain experience.
Computer Engineering 1 nd Semester Dr. Rabie A. Ramadan 2.
1 Editing a C Program 01/16/15. 2 Objective Use Linux to edit, compile and execute a C program.
TAMU CSCE 313 (the basics). Basic Unix/Linux programming Accessing CS systems  PuTTY (putty.exe) – a Telnet and SSH client  Common hosts: unix.cs.tamu.edu.
ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150.
UNIX Introduction CSCE 221H Texas A&M University.
Getting started: Basics Outline: I.Connecting to cluster: ssh II.Connecting outside UCF firewall: VPN client III.Introduction to Linux IV.Intoduction to.
Compiling a C Program. Before we can begin we must open a telnet session to phobos. There are a number of ways to do this, but the easiest is to click.
CS140: Intro to CS An Overview of Programming in C (part 3) by Erin Chambers.
Basic Unix Commands CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang.
Click here to create a new account Click here to check the system for an existing account Enter the site by typing in your User ID and Password and clicking.
1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.
Agenda Steps to Obtain your Phobos and Matrix Accounts. How to use a Telnet Application to Access your Phobos and Matrix Accounts How to Create an Effective.
Creating Programs on UNIX This term you can create programs on UNIX or you can create programs using a C++ compiler on your PC. This set of slides steps.
8-2 What is a program? What is a “Window Manager” ? What is a “GUI” ? How do you navigate the Unix directory tree? What is a wildcard? Readings: See CCSO’s.
Setup Environment: Instructions for CS1520 Server Setup Nils Murrugarra
COP3502: Introduction to Computer Science Yashas Shankar Lecture #2.
1 Getting Started with C++ Part 2 Linux. 2 Getting Started on Linux Now we will look at Linux. See how to copy files between Windows and Linux Compile.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
Basic Unix Commands & GCC Saurav Karmakar Spring 2007.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
A Mini UNIX Tutorial. What’s UNIX?  An operating system run on many servers/workstations  Invented by AT&T Bell Labs in late 60’s  There are many different.
1 CS101 Fall 2001 Lecture 1 In order to write a program, you must first telnet to your pegasus account and login either from a Rutgers computer in a lab,
CS 120 Extra: The CS1 Server Tarik Booker CS 120.
Linux CSE 1222 CSE1222: Lecture 1BThe Ohio State University1.
CMSC 104, Version 9/011 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
1 N305 C Programming. 2 Objectives for the Lab ä Learn problem solving strategies ä Achieve intermediate knowledge of C Programming Language ä Gain experience.
Chapter 3: Mastering Editors Chapter 3 Mastering Editors (Emacs)
Tutorial Six Linux Basics CompSci Semester Two 2016.
ENEE150 Discussion 01 Section 0101 Adam Wang.
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
How to Work on your METEO 473 codes from your PC at home
Development Environment
CS1010: Intro Workshop.
Tutorial Six Recap & Linux Basics CompSci Semester Two 2016.
Prepared by: Eng. Maryam Adel Abdel-Hady
UNIX The Basics Source:
Chapter 2 part #1 C++ Program Structure
Guide To UNIX Using Linux Third Edition
Computer Engineering 1nd Semester
Welcome to CSCI 230! Problem Solving using C
Creating Programs on UNIX
Intro to UNIX System and Homework 1
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Welcome to CSCI 230! Problem Solving using C
Dima Kassab & Luis Ibanez SUNY-Albany 2013
Operating Systems and Using Linux
Operating Systems Lecture 5.
Lab 00 Discussion Linux Basics
Getting Started: Developing Code with Cloud9
Run Java file with Window cmd
CGS 3175: Internet Applications Fall 2009
Using screens and adding two numbers - addda.cbl
CSCE 206 Lab Structured Programming in C
Instructions for Accessing Dell Data
Chapter 2 part #1 C++ Program Structure
Presentation transcript:

First Day in Lab Making a C++ program CS-1511 Computer Science I

Desktop Click the Apps4U icon

Apps4U Loading Screen

Scroll down to Putty

Launch Putty

Logging on to Bulldog bulldog.d.umn.edu putty

Enter bulldog.d.umn.edu Click Open

Click Yes

Type in your UMD account name, hit Enter, Then type your password, hit Enter Note: none of the password characters you type will display on the screen, however, they are being entered so keep going. You know you are on unix when you see bulldog~% or a prompt ending in % bulldog~% Put the mouse aside. You won’t be needing it for a while.

Creating a C++ File This is hello.cpp Type your C++ instructions here bulldog~% nano hello.cpp bulldog~% When finished hit Ctrl-x to leave

Using nano Log into your unix account. You know you are there when you see the % prompt. % means “I am ready for your first command” We use the nano text editor to create files. The first file we create we will call hello.cpp. After we have created our file we will leave the nano editor, saving the file we made. Note: Another program similar to nano is called pico. Both work exactly the same way.

Create the file hello.cpp using the nano text editor nano hello.cpp bulldog~% nano hello.cpp

You are in the nano editor and the file you are creating is hello.cpp

Type in the code you see here

When you are finished hold down the Ctrl key and hit X

If you want to save your changes type Y If you want the file to be called hello.cpp hit Enter

The compilation process hello.cpp a.out 1010110110011 0101000010010 0000010011101 0010111011011 1110110110001 1010110100100 g++ hello.cpp g++ a C++ compiler

Compiling Your C++ Program After we have created our file we will leave the nano editor, saving the file we made. That puts us back in unix. You will now see another bulldog~% prompt. This means “I am ready for your next command” Our second command will compile the C++ file we created (hello.cpp) using the g++ compiler. To compile our program type g++ hello.cpp This makes an executable version called a.out At the next unix prompt we can run a.out by typing ./a.out The results will be displayed.

Type g++ hello.cpp to compile your program bulldog~% nano hello.cpp bulldog~% g++ hello.cpp You are now back in unix Type g++ hello.cpp to compile your program

bulldog~% nano hello.cpp bulldog~% g++ hello.cpp bulldog~% a.out a.out: Command not found bulldog~% ./a.out Hello World!bulldog~% To run your program type ./a.out You should see the results

Go back into nano and insert a \n (new line) character Go back into nano and insert a \n (new line) character. Then save it, recompile, and run again

Now it runs and produces a new line bulldog~% nano hello.cpp bulldog~% g++ hello.cpp bulldog~% a.out aout: command not found bulldog~% ./a.out Hello World!bulldog~% nano hello.cpp Hello World! bulldog~% Now it runs and produces a new line

bulldog~% nano hello.cpp bulldog~% g++ hello.cpp bulldog~% a.out aout: command not found bulldog~% ./a.out Hello World!bulldog~% nano hello.cpp Hello World! bulldog~% logout Leave by logging out logout

Unix Commands Commands you know nano file1.cpp opens the nano editor with file1.cpp g++ file1.cpp compiles file1.cpp using the g++ compiler logout logs you out of the system

Unix Commands Other unix commands you might want to try ls lists your files pwd print working directory (tells you where you are) cp file1.cpp file2.cpp copies file1.cpp onto a new file called file2.cpp ! Runs the last command that begins with a letter

Logout Screen Don’t forget to Logoff