Introduction to Algorithms and Programming I Lab. Exercises #1 Solution
|
|
- Domenic Jackson
- 5 years ago
- Views:
Transcription
1 Introduction to Algorithms and Programming I Lab. Exercises #1 Solution Objectives are to: 1. Learn basic Unix commands for preparing a source C program file, compiling a C program and executing a C program with input data from the keyboard. Also, learn how to use script file for handing in record of source program file, compilation and execution of programs. 2. Practise on concepts taught in chapter 1 of text including how to present solutions to simple problems in the form of an algorithm (or program), how to identify the necessary input and output data of a problem. Also, practise on conversions of numeric values from one number base to another, and character data from character to ASCII code and vice versa. Que. 1. Type, compile and run the C program of Figure 1.15 in the course book. This program computes and prints the binary number equivalent of any given positive decimal number. Hand in or show your source program file, the input data and the output of your run. Use the following set of input data: Solution to Que 1 /* Given a decimal number, convert it to its binary equivalent. We are also including <math.h> to use math built functions, but must compile with the -lm option to link in math library with command cc -lm file.c */ #include <stdio.h> #include <math.h> /* Given a decimal number, convert it to its binary equivalent. For example, given 52, it returns Note though that we can only work with integer numbers and we need to find a way to present our output binary number like correctly as an integer. */ int main (void) { int num_d; /*input number */ int num_b; /* output number with only digits 1 and 0 */ int decimalnum, quotient, remainder, power2; /* other variables */
2 /* Now sequence of instructions for solving the problem */ printf("type the decimal number you want to convert to binary:\t"); scanf ("%d", &num_d); /*read decimal number */ power2 = 0; /* we set the bit position as least significant */ num_b = 0; /* set the current binary number to 0 */ /* compute its binary equivalent */ decimalnum = num_d; /* make a copy of the decimal number */ step5: quotient = num_d / 2; remainder = num_d % 2; num_b = num_b + (remainder * pow (10, power2)); if (quotient!= 0) { num_d = quotient; power2 = power2 + 1; goto step5; /* this repetition is better done with while loop instruction but kept this way for simplicity */ /* print the number and its binary equivalent */ printf ("Binary equivalent of %d is %d.\n", decimalnum, num_b); return 0; Que. 2. Compile and run the same program of Figure 1.15 of text and show the source code, compilation, execution, program input and output data in a script file. Solution to Que 2 A record of all Unix commands executed during a logon session or part of a logon session can be saved in a script file by simply initiating the recording with the Unix script command and ending the recording when completed, with an exit command as follows. i. Open a Unix terminal window and type: script lab01_scriptfile [The general command is script filename, our script file here is lab01_scrptfile] ii. Now display your source program file with the Unix cat command as: cat lab01.c [The command cat filename is used to display contents of filename on the screen] iii. Now compile the program by typing: cc lab01.c
3 iv. Now Run the program by typing: a.out v. Now, the CPU is waiting for you to type in a positive decimal number as before. You can re-run the program with the following decimal numbers vi. After the result of the program has been displayed, you must exit script session by typing: exit [Failure to exit will prevent the script file from being saved and created.] Que. 3. Practise with other Unix commands to list all the files in your directory, see the contents of your script file, send the script file to your GA, send your script file to your home computer so that you can print it. Solution to Que 3 i. To see all files in the current directory including the script file, type: ls ii. To see contents of the script file, type: cat lab01_scriptfile or more lab01_scriptfile iii. To send a file like your script file lab01_scriptfile (which is currently on the server.uwindsor.ca) to your home computer so that you can print it, you need to use SSH file transfer program (SFTP) to transfer files from one computer (e.g., sol.cs.uwindsor.ca) to another (e.g., a PC or laptop). Note that you can only do this exercise when you have a PC or laptop and still connected to a Unix server. Thus, you can complete it at home to learn how to transfer your files and assignments. To use SFTP, follow the steps below: a. From your home PC computer or any PC or laptop that has internet connection and already has the SSH client installed on it, launch the SSH client software to log on to a campus Unix server from PC. You can log on to sol.cs.uwindsor.ca or any new server name available at the time of doing this lab. While the SSH terminal or window is used to issue any Unix command on the remote server, the SFTP terminal or window is used to transfer files between the two computers. Open up the SFTP terminal (the secure file transfer program) icon. This SFTP window looks like popular Windows explorer window. On the SFTP window, there are two panes where the left pane has a listing of files in the local computer (e.g., PC or laptop) and the right pane has a listing of files in the remote computer (e.g., the Unix server like sol.cs.uwindsor.ca). b. Use the SFTP menu commands to download files from Unix server to PC and to upload files from PC to Unix server. You can also just drag and drop files from one computer (e.g., right pane) to another (e.g., left pane) the same way you would do it with Windows explorer.
4 Now, download your scriptfile called lab01_scriptfile. c. Print your scriptfile lab01_scriptfile with a printer connected to the PC or laptop. Once you have downloaded your scriptfile lab01_scriptfile onto your PC, you can open it up with Wordpad or Notepad and print the file so it can be handed in for marking later. iv Practise with other Unix commands for creating and deleting directory, deleting file, changing directory, renaming a file, making a copy of a file and so on. To create a new directory on Unix, use the mkdir command as: mkdir dirname v. To change to a different directory on Unix, use the cd as: cd dirname [Note that dirname stands for the entire path of the directory from root (/)or home directory (~)]. vi. To move up one directory, for example to the parent directory, use: cd.. vii. Wherever you are, to go to your home directory, use: cd ~ viii. To make a copy of lab01.c file and keep in lab01cp.c, use: cp lab01.c lab01cp.c ix. To delete a file like delete lab01.c after making a copy, use: rm lab01.c x. To rename a file from lab01.c to lab02.c, use: mv lab01.c lab02.c Use the ASCII table in Appendix A of course text, for exercises involving ASCII conversion. Que. 4. Here is a message coded in ASCII using eight bits per symbol. What does it say? Solution to Que = 73 = I = 32 = = 119 = w = 111 = o = 114 = r = 107 = k = 32 = = 104 = h = 97 = a = 114 = r = 100 = d = 46 =.
5 Que. 5. Show how the following instructions are represented in binary using ASCII by writing the codes for the instructions. Q /= 20; a--; Solution to Que 5 a. b. Q = / = = = = ; = a = = = ; = Que. 6. Convert each of the following binary representations to its decimal form. (a) (b) (c.) Solution to Que 6 a = 52 b = 64 c = 127 Que. 7. Convert each of the following decimal representations to its equivalent binary form. (a) 21 (b) 53 (c.) 400 Solution to Que 7 a. 21 = b. 53 = c. 400 = Que. 8. Name all the hardware components of the computer and identify the function of each component.
6 Solution to Que 8 Hardware Component Function of Component Input device Used to accept input from user Output device Used to display computer output to the user Memory Used to store programs and data to be Primary memory processed by the computer. Secondary memory CPU (central processing unit) Used to process program instructions. Que. 9.What is an algorithm? What is a program?, What is a problem?, What are input and output data? Solution to Que 9 An algorithm is a sequence of steps for transforming input data to a desired output data. A problem has some input data, some output data and needs an algorithm for transforming its input data to its output data. A program is the version of an algorithm written in a Computer executable language like a computer high-level or low-level language Que. 10. For each of the conversions you did in problems (4) to (7) above identify the input, output and algorithm. Solution to Que 10 The coarse algorithms are: Qu4: Input: numbers(representing binary equivalent of a character), ASCII table Output: a string of characters Algorithm: For each input number do: read each eight digit integer number representing a binary number convert this binary number to its to decimal equivalent convert this decimal number to ascii character using the ASCII table print out the ASCII character equivalent for the decimal number. repeat Qu5: Input: string of characters, ASCII table Output: binary numbers Algorithm: For each input character do:
7 read each each input charact convert each character to decimal value using the ASCII table convert the decimal value to binary number print binary number repeat Qu6: Input: binary number (binary) Output: decimal number (dec) Intermediate: powerof2 = 0, quotient, remainder Algorithm read in binary number dec = 0 remainder = binary%10 quotient = binary/10 while (quotient!= 0) do: { dec = dec + (remainder * (2 ^ powerof2)) powerof2 = powerof2 + 1 remainder = quotient % 10 quotient = quotient / 10 print dec Qu7: Input: decimal number (decimal) Output: binary number (binary) Intermediate: powerof10 = 0, quotient, remainder Algorithm: read decimal number binary = 0 remainder = decimal % 2 quotient = decimal / 2 binary = binary + (remainder * (10 ^ powerof2)) while (quotient!= 0) do { power2 = power2 + 1 remainder = quotient % 2 quotient = quotient / 2 binary = binary + (remainder * (10 ^ powerof2)) print binary
3/13/2012. ESc101: Introduction to Computers and Programming Languages
ESc101: Introduction to Computers and Programming Languages Instructor: Krithika Venkataramani Semester 2, 2011-2012 The content of these slides is taken from previous course lectures of Prof. R. K. Ghosh,
More informationSession 1: Accessing MUGrid and Command Line Basics
Session 1: Accessing MUGrid and Command Line Basics Craig A. Struble, Ph.D. July 14, 2010 1 Introduction The Marquette University Grid (MUGrid) is a collection of dedicated and opportunistic resources
More informationProgramming and Data Structure Laboratory (CS13002)
Programming and Data Structure Laboratory (CS13002) Dr. Sudeshna Sarkar Dr. Indranil Sengupta Dept. of Computer Science & Engg., IIT Kharagpur 1 Some Rules to be Followed Attendance is mandatory. Regular
More informationLab 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 informationProgramming Studio #1 ECE 190
Programming Studio #1 ECE 190 Programming Studio #1 Announcements In Studio Assignment Introduction to Linux Command-Line Operations Recitation Floating Point Representation Binary & Hexadecimal 2 s Complement
More informationBeyond this course. Machine code. Readings: CP:AMA 2.1, 15.4
Beyond this course Readings: CP:AMA 2.1, 15.4 CS 136 Spring 2018 13: Beyond 1 Machine code In Section 04 we briefly discussed compiling: converting source code into machine code so it can be run or executed.
More informationCS CS Tutorial 2 2 Winter 2018
CS CS 230 - Tutorial 2 2 Winter 2018 Sections 1. Unix Basics and connecting to CS environment 2. MIPS Introduction & CS230 Interface 3. Connecting Remotely If you haven t set up a CS environment password,
More informationProgramming Studio #1 ECE 190
Programming Studio #1 ECE 190 Programming Studio #1 Announcements Recitation Binary representation, hexadecimal notation floating point representation, 2 s complement In Studio Assignment Introduction
More informationChapter 1 An Introduction to C++, Unix, SSH and Komodo Edit
Chapter 1 An Introduction to C++, Unix, SSH and Komodo Edit Contents 1 An Introduction to C++, Unix, SSH and Komodo Edit 1.1 Introduction 1.2 The C++ Language 1.2.1 A Brief Introduction 1.2.1.1 Recommended
More information1. The Mac Environment in SIE 1222
Friday, September 1, 2017 Lab Notes Topics for today The Mac Environment C (and Unix) Notes on C Part 1 Program 1 1. The Mac Environment in SIE 1222 a. Turning on the Mac If the Mac is in sleep mode you
More informationLab 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. The doc is
More informationIntermediate Programming, Spring Misha Kazhdan
600.120 Intermediate Programming, Spring 2017 Misha Kazhdan Outline Unix/Linux command line Basics of the Emacs editor Compiling and running a simple C program Cloning a repository Connecting to ugrad
More informationPractical Session 0 Introduction to Linux
School of Computer Science and Software Engineering Clayton Campus, Monash University CSE2303 and CSE2304 Semester I, 2001 Practical Session 0 Introduction to Linux Novell accounts. Every Monash student
More informationCSCE 212H, Spring 2008, Matthews Lab Assignment 1: Representation of Integers Assigned: January 17 Due: January 22
CSCE 212H, Spring 2008, Matthews Lab Assignment 1: Representation of Integers Assigned: January 17 Due: January 22 Manton Matthews January 29, 2008 1 Overview The purpose of this assignment is to become
More information1. The Mac Environment in Sierra Hall 1242
Wednesday, August 26, 2015 Lab Notes Topics for today The Mac Environment C (and Unix) Notes on C Part 1 Program 1 1. The Mac Environment in Sierra Hall 1242 a. Turning on the Mac If the Mac is in sleep
More informationCpSc 1111 Lab 1 Introduction to Unix Systems, Editors, and C
CpSc 1111 Lab 1 Introduction to Unix Systems, Editors, and C Welcome! Welcome to your CpSc 111 lab! For each lab this semester, you will be provided a document like this to guide you. This material, as
More informationUnix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University
Unix/Linux Basics 1 Some basics to remember Everything is case sensitive Eg., you can have two different files of the same name but different case in the same folder Console-driven (same as terminal )
More informationTemple University Computer Science Programming Under the Linux Operating System January 2017
Temple University Computer Science Programming Under the Linux Operating System January 2017 Here are the Linux commands you need to know to get started with Lab 1, and all subsequent labs as well. These
More informationIntroduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University
Introduction to Linux Woo-Yeong Jeong (wooyeong@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu What is Linux? A Unix-like operating system of a computer What is an
More informationIntroduction to Linux
Introduction to Linux Prof. Jin-Soo Kim( jinsookim@skku.edu) TA - Dong-Yun Lee (dylee@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu What is Linux? A Unix-like operating
More informationUnit 10. Linux Operating System
1 Unit 10 Linux Operating System 2 Linux Based on the Unix operating system Developed as an open-source ("free") alternative by Linux Torvalds and several others starting in 1991 Originally only for Intel
More informationCpSc 111 Lab 5 Conditional Statements, Loops, the Math Library, and Redirecting Input
CpSc Lab 5 Conditional Statements, Loops, the Math Library, and Redirecting Input Overview For this lab, you will use: one or more of the conditional statements explained below scanf() or fscanf() to read
More informationChapter 1 An Introduction to C++, Unix, SSH and Komodo Edit
Chapter 1 An Introduction to C++, Unix, SSH and Komodo Edit A portion of this lab is to be done during the scheduled lab time. The take-home programming assignment is to be turned in before the next lab;
More informationUnit 13. Linux Operating System Debugging Programs
1 Unit 13 Linux Operating System Debugging Programs COMPILATION 2 3 Editors "Real" developers use editors designed for writing code No word processors!! You need a text editor to write your code Eclipse,
More informationIntroduction. SSH Secure Shell Client 1
SSH Secure Shell Client 1 Introduction An SSH Secure Shell Client is a piece of software that allows a user to do a number of functions. Some of these functions are: file transferring, setting permissions,
More informationCS 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 informationWorking with Basic Linux. Daniel Balagué
Working with Basic Linux Daniel Balagué How Linux Works? Everything in Linux is either a file or a process. A process is an executing program identified with a PID number. It runs in short or long duration
More informationSU2017. LAB 1 (May 4/9) Introduction to C, Function Declaration vs. Definition, Basic I/O (scanf/printf, getchar/putchar)
SU2017. LAB 1 (May 4/9) Introduction to C, Function Declaration vs. Definition, Basic I/O (scanf/printf, getchar/putchar) 1 Problem A 1.1 Specification Write an ANSI-C program that reads input from the
More informationWhen talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used:
Linux Tutorial How to read the examples When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used: $ application file.txt
More informationOregon State University School of Electrical Engineering and Computer Science. CS 261 Recitation 1. Spring 2011
Oregon State University School of Electrical Engineering and Computer Science CS 261 Recitation 1 Spring 2011 Outline Using Secure Shell Clients GCC Some Examples Intro to C * * Windows File transfer client:
More informationTurn-in your project from your Windows PC
You can work on CS180 projects at home using your laptop. You also can turnin your CS180 project from your laptop. This document explains you how to do that. Turn-in your project from your Windows PC Before
More informationHelpful Tips for Labs. CS140, Spring 2015
Helpful Tips for Labs CS140, Spring 2015 Linux/Unix Commands Creating, Entering, Changing Directories to Create a Directory (a Folder) on the command line type mkdir folder_name to Enter that Folder cd
More informationCMSC 104 Lecture 2 by S Lupoli adapted by C Grasso
CMSC 104 Lecture 2 by S Lupoli adapted by C Grasso A layer of software that runs between the hardware and the user. Controls how the CPU, memory and I/O devices work together to execute programs Keeps
More informationUnix Basics. Systems Programming Concepts
Concepts Unix directories Important Unix file commands man, pwd, ls, mkdir, cd, cp, mv File and directory access rights through permission settings Using chmod to change permissions Other important Unix
More informationThe Unix Shell & Shell Scripts
The Unix Shell & Shell Scripts You should do steps 1 to 7 before going to the lab. Use the Linux system you installed in the previous lab. In the lab do step 8, the TA may give you additional exercises
More informationCS11001/CS11002 Programming and Data Structures Autumn/Spring Semesters. Introduction
Title page CS11001/CS11002 Programming and Data Structures Autumn/Spring Semesters Introduction Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Last modified: July
More informationIntroduction: The Unix shell and C programming
Introduction: The Unix shell and C programming 1DT048: Programming for Beginners Uppsala University June 11, 2014 You ll be working with the assignments in the Unix labs. If you are new to Unix or working
More informationC++ Programming on Linux
C++ Programming on Linux What is Linux? CS 2308 Spring 2017 Jill Seaman Slides 14-end are for your information only, you will not be tested over that material. 1 l an operating system l Unix-like l Open
More informationLAB 1 INTRODUCTION TO LINUX ENVIRONMENT AND C COMPILER
LAB 1 INTRODUCTION TO LINUX ENVIRONMENT AND C COMPILER School of Computer and Communication Engineering Universiti Malaysia Perlis 1 1. GETTING STARTED: 1.1 Steps to Create New Folder: 1.1.1 Click Places
More informationAMS 200: Working on Linux/Unix Machines
AMS 200, Oct 20, 2014 AMS 200: Working on Linux/Unix Machines Profs. Nic Brummell (brummell@soe.ucsc.edu) & Dongwook Lee (dlee79@ucsc.edu) Department of Applied Mathematics and Statistics University of
More informationCS19001/CS19002 Programming and Data Structures Lab Autumn/Spring Semester. Introduction. Abhijit Das. January 4, 2015
Title page CS19001/CS19002 Programming and Data Structures Lab Autumn/Spring Semester Introduction Abhijit Das Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur January
More informationLecture 1. A. Sahu and S. V. Rao. Indian Institute of Technology Guwahati
Lecture 1 Introduction to Computing A. Sahu and S. V. Rao Dept of Comp. Sc. & Engg. Indian Institute of Technology Guwahati 1 Outline Computer System Problem Solving and Flow Chart Linux Command ls, mkdir,
More informationCSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2
CSE Linux VM For Microsoft Windows Based on opensuse Leap 42.2 Dr. K. M. Flurchick February 2, 2017 Contents 1 Introduction 1 2 Requirements 1 3 Procedure 1 4 Usage 3 4.1 Start/Stop.................................................
More informationParallel Programming Pre-Assignment. Setting up the Software Environment
Parallel Programming Pre-Assignment Setting up the Software Environment Authors: B. Wilkinson and C. Ferner. Modification date: Aug 21, 2014 (Minor correction Aug 27, 2014.) Software The purpose of this
More informationFor Dr Landau s PHYS8602 course
For Dr Landau s PHYS8602 course Shan-Ho Tsai (shtsai@uga.edu) Georgia Advanced Computing Resource Center - GACRC January 7, 2019 You will be given a student account on the GACRC s Teaching cluster. Your
More informationPDS Lab Section 16 Autumn Tutorial 1. Unix Commands pwd The pwd command displays the full pathname of the current directory.
PDS Lab Section 16 Autumn-2018 Tutorial 1 Unix Commands pwd The pwd command displays the full pathname of the current directory. pwd mkdir The mkdir command creates a single directory or multiple directories.
More informationChapter 3 DATA REPRESENTATION
Page1 Chapter 3 DATA REPRESENTATION Digital Number Systems In digital systems like computers, the quantities are represented by symbols called digits. Many number systems are in use in digital technology
More informationEECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou
EECS 2031 - Software Tools Lab 2 Tutorial: Introduction to UNIX/Linux Tilemachos Pechlivanoglou (tipech@eecs.yorku.ca) Sep 22 & 25, 2017 Material marked with will be in your exams Sep 22 & 25, 2017 Introduction
More informationInteger Representation. Variables. Real Representation. Integer Overflow/Underflow
Variables Integer Representation Variables are used to store a value. The value a variable holds may change over its lifetime. At any point in time a variable stores one value (except quantum computers!)
More informationCS11002 Programming and Data Structures Spring Introduction
Title page CS11002 Programming and Data Structures Spring 2008 Goutam Biswas Abhijit Das Dipankar Sarkar Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Jan 04, 2008
More informationHow to SFTP to nice.fas.harvard.edu from Windows
How to SFTP to nice.fas.harvard.edu from Windows Recall that nice.fas.harvard.edu refers to a cluster of computers running Linux on which you have an account (your so-called FAS account). On this cluster
More informationLab 1 1 Due Wed., 2 Sept. 2015
Lab 1 1 Due Wed., 2 Sept. 2015 CMPSC 112 Introduction to Computer Science II (Fall 2015) Prof. John Wenskovitch http://cs.allegheny.edu/~jwenskovitch/teaching/cmpsc112 Lab 1 - Version Control with Git
More informationCENG393 Computer Networks Labwork 1
CENG393 Computer Networks Labwork 1 Linux is the common name given to a large family of operating systems. All Linux-based operating systems are essentially a large set of computer software that are bound
More informationGuided Tour (Version 3.3) By Steven Castellucci as Modified by Brandon Haworth
Guided Tour (Version 3.3) By Steven Castellucci as Modified by Brandon Haworth This document was inspired by the Guided Tour written by Professor H. Roumani. His version of the tour can be accessed at
More informationCMPT 300. Operating Systems. Brief Intro to UNIX and C
CMPT 300 Operating Systems Brief Intro to UNIX and C Outline Welcome Review Questions UNIX basics and Vi editor Using SSH to remote access Lab2(4214) Compiling a C Program Makefile Basic C/C++ programming
More informationCourse Information and Introduction
August 22, 2017 Course Information 1 Instructors : Email : arash.rafiey@indstate.edu Office : Root Hall A-127 Office Hours : Tuesdays 11:30 pm 12:30 pm. Root Hall, A127. 2 Course Home Page : http://cs.indstate.edu/~arash/cs256.html
More informationBasic Unix Commands. CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang
Basic Unix Commands CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang For this class you need to work from your grove account to finish your homework Knowing basic UNIX commands is essential to finish your homework
More informationIntroduction to Computer Science (I1100) With 1 coin 2 possibilities: Head / Tail or 0/1
With 1 coin 2 possibilities: Head / Tail or 0/1 77 What if I have 2 coins?! 0 0 With 2 coins, I can have 4 possibilities 0 1 1 0 1 1 With 3 coins, I can have 2*2*2=8 possibilities With 4 coins, I can have
More informationOnce you have installed MobaXterm, open MobaXterm. Go to Sessions -> New Session, and click on the SSH icon.
Lab 1 In order to get credit for the lab, you need to be checked off by the end of lab. For nonzero labs, you can earn a maximum of 3 points for lab work completed outside of lab time, but you must finish
More informationLecture 3. Review. CS 141 Lecture 3 By Ziad Kobti -Control Structures Examples -Built-in functions. Conditions: Loops: if( ) / else switch
Lecture 3 CS 141 Lecture 3 By Ziad Kobti -Control Structures Examples -Built-in functions Review Conditions: if( ) / else switch Loops: for( ) do...while( ) while( )... 1 Examples Display the first 10
More informationبسم اهلل الرمحن الرحيم
بسم اهلل الرمحن الرحيم Fundamentals of Programming C Session # 10 By: Saeed Haratian Fall 2015 Outlines Examples Using the for Statement switch Multiple-Selection Statement do while Repetition Statement
More informationUsing the Unix system. UNIX Introduction
Using the Unix system Navigating the Unix file system Editing with emacs Compiling with gcc UNIX Introduction The UNIX operating system is made up of three parts: the kernel, the shell and the programs
More informationTiny Instruction Manual for the Undergraduate Mathematics Unix Laboratory
Tiny Instruction Manual for the Undergraduate Mathematics Unix Laboratory 1 Logging In When you sit down at a terminal and jiggle the mouse to turn off the screen saver, you will be confronted with a window
More informationSystems Programming and Computer Architecture ( ) Exercise Session 01 Data Lab
Systems Programming and Computer Architecture (252-0061-00) Exercise Session 01 Data Lab 1 Goal Get familiar with bit level representations, C and Linux Thursday, September 22, 2016 Systems Programming
More informationCS1600 Lab Assignment 1 Spring 2016 Due: Feb. 2, 2016 POINTS: 10
CS1600 Lab Assignment 1 Spring 2016 Due: Feb. 2, 2016 POINTS: 10 PURPOSE: The purpose of this lab is to acquaint you with the C++ programming environment on storm. PROCEDURES: You will use Unix/Linux environment
More informationIntroduction to Linux. Fundamentals of Computer Science
Introduction to Linux Fundamentals of Computer Science Outline Operating Systems Linux History Linux Architecture Logging in to Linux Command Format Linux Filesystem Directory and File Commands Wildcard
More informationLinux Tutorial. Ken-ichi Nomura. 3 rd Magics Materials Software Workshop. Gaithersburg Marriott Washingtonian Center November 11-13, 2018
Linux Tutorial Ken-ichi Nomura 3 rd Magics Materials Software Workshop Gaithersburg Marriott Washingtonian Center November 11-13, 2018 Wireless Network Configuration Network Name: Marriott_CONFERENCE (only
More informationIntroduction to Linux Environment. Yun-Wen Chen
Introduction to Linux Environment Yun-Wen Chen 1 The Text (Command) Mode in Linux Environment 2 The Main Operating Systems We May Meet 1. Windows 2. Mac 3. Linux (Unix) 3 Windows Command Mode and DOS Type
More informationCSC111 Computer Science II
CSC111 Computer Science II Lab 1 Getting to know Linux Introduction The purpose of this lab is to introduce you to the command line interface in Linux. Getting started In our labs If you are in one of
More informationUoW HPC Quick Start. Information Technology Services University of Wollongong. ( Last updated on October 10, 2011)
UoW HPC Quick Start Information Technology Services University of Wollongong ( Last updated on October 10, 2011) 1 Contents 1 Logging into the HPC Cluster 3 1.1 From within the UoW campus.......................
More informationSaint Louis University. Intro to Linux and C. CSCI 2400/ ECE 3217: Computer Architecture. Instructors: David Ferry
Intro to Linux and C CSCI 2400/ ECE 3217: Computer Architecture Instructors: David Ferry 1 Overview Linux C Hello program in C Compiling 2 History of Linux Way back in the day: Bell Labs Unix Widely available
More informationIntroduction to Linux
Introduction to Linux Prof. Jin-Soo Kim( jinsookim@skku.edu) TA - Kisik Jeong (kisik@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu What is Linux? A Unix-like operating
More informationCS Operating Systems, Fall 2018 Project #0 Description
CS314-002 Operating Systems, Fall 2018 Project #0 Description Due: 11:00 A.M., September 5, 2018 I. Project Narrative: The primary objectives in this project are: (1) confirm your account (user name and
More informationIntroduction to Linux (Part I) BUPT/QMUL 2018/03/14
Introduction to Linux (Part I) BUPT/QMUL 2018/03/14 Contents 1. Background on Linux 2. Starting / Finishing 3. Typing Linux Commands 4. Commands to Use Right Away 5. Linux help continued 2 Contents 6.
More informationCS 3410 Intro to Unix, shell commands, etc... (slides from Hussam Abu-Libdeh and David Slater)
CS 3410 Intro to Unix, shell commands, etc... (slides from Hussam Abu-Libdeh and David Slater) 28 January 2013 Jason Yosinski Original slides available under Creative Commons Attribution-ShareAlike 3.0
More informationWeek 2 Lecture 3. Unix
Lecture 3 Unix Terminal and Shell 2 Terminal Prompt Command Argument Result 3 Shell Intro A system program that allows a user to execute: shell functions (e.g., ls -la) other programs (e.g., eclipse) shell
More informationYour algorithm and program should print values for the following:
60-140 ASSIGNMENT #1 SOLUTION Total: 50 marks Objective of Assignment: To write a simple C program to solve a problem using no decision or repetition instructions and no function calls. Scope: Assignment
More informationcommandname flags arguments
Unix Review, additional Unix commands CS101, Mock Introduction This handout/lecture reviews some basic UNIX commands that you should know how to use. A more detailed description of this and other commands
More informationLezione 8. Shell command language Introduction. Sommario. Bioinformatica. Mauro Ceccanti e Alberto Paoluzzi
Lezione 8 Bioinformatica Mauro Ceccanti e Alberto Paoluzzi Dip. Informatica e Automazione Università Roma Tre Dip. Medicina Clinica Università La Sapienza Sommario Shell command language Introduction A
More informationPython for Astronomers. Week 1- Basic Python
Python for Astronomers Week 1- Basic Python UNIX UNIX is the operating system of Linux (and in fact Mac). It comprises primarily of a certain type of file-system which you can interact with via the terminal
More informationCENG 334 Computer Networks. Laboratory I Linux Tutorial
CENG 334 Computer Networks Laboratory I Linux Tutorial Contents 1. Logging In and Starting Session 2. Using Commands 1. Basic Commands 2. Working With Files and Directories 3. Permission Bits 3. Introduction
More informationPlease choose the best answer. More than one answer might be true, but choose the one that is best.
Introduction to Linux and Unix - endterm Please choose the best answer. More than one answer might be true, but choose the one that is best. SYSTEM STARTUP 1. A hard disk master boot record is located:
More informationUnix Tutorial Haverford Astronomy 2014/2015
Unix Tutorial Haverford Astronomy 2014/2015 Overview of Haverford astronomy computing resources This tutorial is intended for use on computers running the Linux operating system, including those in the
More informationIntroduction to Computing V - Linux and High-Performance Computing
Introduction to Computing V - Linux and High-Performance Computing Jonathan Mascie-Taylor (Slides originally by Quentin CAUDRON) Centre for Complexity Science, University of Warwick Outline 1 Program Arguments
More informationContents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...
Contents Note: pay attention to where you are........................................... 1 Note: Plaintext version................................................... 1 Hello World of the Bash shell 2 Accessing
More informationVariables Data types Variable I/O. C introduction. Variables. Variables 1 / 14
C introduction Variables Variables 1 / 14 Contents Variables Data types Variable I/O Variables 2 / 14 Usage Declaration: t y p e i d e n t i f i e r ; Assignment: i d e n t i f i e r = v a l u e ; Definition
More informationWorking with Shell Scripting. Daniel Balagué
Working with Shell Scripting Daniel Balagué Editing Text Files We offer many text editors in the HPC cluster. Command-Line Interface (CLI) editors: vi / vim nano (very intuitive and easy to use if you
More informationCOMP s1 Lecture 1
COMP1511 18s1 Lecture 1 1 Numbers In, Numbers Out Andrew Bennett more printf variables scanf 2 Before we begin introduce yourself to the person sitting next to you why did
More informationThe Shell. EOAS Software Carpentry Workshop. September 20th, 2016
The Shell EOAS Software Carpentry Workshop September 20th, 2016 Getting Started You need to download some files to follow this lesson. These files are found on the shell lesson website (see etherpad) 1.
More informationGuided Tour (Version 3.4) By Steven Castellucci
Guided Tour (Version 3.4) By Steven Castellucci This document was inspired by the Guided Tour written by Professor H. Roumani. His version of the tour can be accessed at the following URL: http://www.cse.yorku.ca/~roumani/jbayork/guidedtour.pdf.
More informationSTA 303 / 1002 Using SAS on CQUEST
STA 303 / 1002 Using SAS on CQUEST A review of the nuts and bolts A.L. Gibbs January 2012 Some Basics of CQUEST If you don t already have a CQUEST account, go to www.cquest.utoronto.ca and request one.
More informationComputer Organization and Assembly Language. Lab Session 01
Objective: Lab Session 01 Introduction to Assembly Language Tools and Familiarization with Emu8086 environment To be able to understand Data Representation and perform conversions from one system to another
More informationIntroduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines
Introduction to UNIX Logging in Basic system architecture Getting help Intro to shell (tcsh) Basic UNIX File Maintenance Intro to emacs I/O Redirection Shell scripts Logging in most systems have graphical
More informationFILE MAINTENANCE COMMANDS
Birla Institute of Technology & Science, Pilani Computer Programming (CS F111) Lab-2 ----------------------------------------------------------------------------------------------------------------------
More informationUnix Introduction to UNIX
Unix Introduction to UNIX Get Started Introduction The UNIX operating system Set of programs that act as a link between the computer and the user. Developed in 1969 by a group of AT&T employees Various
More informationIntroduction to Linux
Introduction to Linux Prof. Jin-Soo Kim( jinsookim@skku.edu) TA Sanghoon Han(sanghoon.han@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Announcement (1) Please come
More informationUnix as a Platform Exercises. Course Code: OS-01-UNXPLAT
Unix as a Platform Exercises Course Code: OS-01-UNXPLAT Working with Unix 1. Use the on-line manual page to determine the option for cat, which causes nonprintable characters to be displayed. Run the command
More informationRefresher workshop in programming for polytechnic graduates General Java Program Compilation Guide
Refresher workshop in programming for polytechnic graduates General Java Program Compilation Guide Overview Welcome to this refresher workshop! This document will serve as a self-guided explanation to
More informationOperating Systems and Using Linux. Topics What is an Operating System? Linux Overview Frequently Used Linux Commands
Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands 1 What is an Operating System? A computer program that: Controls how the CPU, memory
More informationCS102: Standard I/O. %<flag(s)><width><precision><size>conversion-code
CS102: Standard I/O Our next topic is standard input and standard output in C. The adjective "standard" when applied to "input" or "output" could be interpreted to mean "default". Typically, standard output
More information