ACE Tutorial. October, 2013 Byoung K. Choi and Donghun Kang

Size: px
Start display at page:

Download "ACE Tutorial. October, 2013 Byoung K. Choi and Donghun Kang"

Transcription

1 ACE Tutorial October, 2013 Byoung K. Choi and Donghun Kang

2 Objective This document aims to provide a minimum tutorial guide for a beginner to get started with the activity-based simulation tool kit ACE. It gives a procedural description of how to build an ACE simulation program that ranges from creating a blank activity transition table to running the simulation. Recommendation Prior to reading this document, the readers are recommended to read and understand Chapter 6 ( 6.6) of the textbook, Modeling and Simulation of Discrete-Event Systems by Choi and Kang. History of This Document Date Version Reason Person(s) in charge 05/10/ Initial Draft Byoung K. Choi <bkchoi@kaist.ac.kr> 05/16/ Second Draft Donghun Kang <donghun.kang@kaist.ac.kr> Donghun Kang <donghun.kang@kaist.ac.kr> 02/13/ Third Draft with modeling with canceling arc 02/19/ Final Document Byoung K. Choi <bkchoi@kaist.ac.kr> 2

3 Table of Contents 1. Basic Features of ACE Modeling of a Single Server System Create a blank ATT (Activity Transition Table) Declare Queues C, M and Q with initial values (C=1, M=1, Q=3) Building the Activity Transition Table (ATT) Initialize Enabled Activities = {Create} Run the Simulation Declaring Variables Modeling with Canceling Arcs Additional Modeling Features Random Variate Generation Functions Syntax for Specifying Conditions and Actions

4 1. Basic Features of ACE ACE is an ACD-model executor whose input is a formal ACD model specified in the form of an activity transition table. The main window of ACE is divided into three regions: Main Menu, Activity Transition Table (ATT) Window, and Spreadsheet Window. Also provided are three tool bars: ATT Tool Bar in the ATT Window, and Queue Tool Bar and Variable Tool Bar in the Spreadsheet Window. The procedure of building an ACE simulation program consists of the following: 1) Create a blank Activity Transition Table. 2) Declare all Queues and Variables in the Spreadsheet Window 3) Build the Activity Transition Table in the ATT window 4) Initialize Enabled Activities 5) Run the simulation The above procedure will be explained with the Activity Transition Table of a single server system given below. ACE supports a number of random variate generation functions including Exp (μ), Erlang (α, λ), Beta (α, β), and Uni (α, β). The procedure for declaring Variables will be described with another example. 4

5 2. Modeling of a Single Server System 2.1 Create a blank ATT (Activity Transition Table) 1) At the Main Menu, click File New to create a blank ATT. 2.2 Declare Queues C, M and Q with initial values (C=1, M=1, Q=3) 1 In the Spreadsheet Window, select the Queue tap to bring up the Queue Tool Bar and then (a) click Add-queue ( ) button to (b) create a new row (Queue1) for the queue C as shown below: 2 In the Spreadsheet Window, specify the attribute values of Queue1 as follows: (a) Name = C; (b) Type = Creator; (c) Initial Value = 1. 3 At the Queue Tool Bar, (a) Click Add-queue ( (Queue2) for the queue M as shown below: ) button to (b) append a new row 5

6 4 In the Spreadsheet Window, specify the attribute values of Queue2 as {Name = M; Type = Resource; Initial Value = 1}. 5 At the Queue Tool Bar, Click Add-queue ( ) button to append a new row for the queue Q. 6 In the Spreadsheet Window, specify the attributes in the appended row as {Name = Q; Type = Entity; Initial Value = 3} and then provide the queue names in the Description fields as follows: 7 In the ATT Window, check if the queues C, M and Q are properly initialized. 2.3 Building the Activity Transition Table (ATT) 1 In the ATT Window, (1) select Activity1 and (2) click Add-arc ( an additional arc for the activity Activity1. ) button to create 6

7 2 In the ATT Window, set the name of Activity 1 to Create and specify all the data for the selected activity. 3 In the ATT Window, (1) select Create and (2) click Add-activity ( append another activity Activity2 after the Create activity. ) button to 4 In the ATT Window, set the name of Activity 2 to Process and specify all the data for the selected activity. 2.4 Initialize Enabled Activities = {Create} 1 In the ATT Window, (1) select Create and (2) click Enabled-activity ( ) button to make Create an Enabled Activity as shown below. Now the ATT is completely defined! 7

8 2.5 Run the Simulation 1 At the Main Menu, click File Save As as shown below, and give the folder name and file name to store the completed ATT (activity transition table). 2 At the Main Menu, click Run Run Options to open the Run Options dialog box and then specify run options as shown below: EOS (end of simulation) time = 500; Random (number) Seed = 12345; and check the System Trajectories box. 3 At the Run Options dialog box, click Save & Run to run the simulation. Check the Output Report and Output Plots as shown below. 8

9 3. Declaring Variables In ACE, all variables are regarded as 2-dimensional array. A simple (non-array) variable is regarded as a 1x1 array. All variables are initially set to zero as a default. Methods of declaring an integer k and an integer array N[12] = {0, 0, 0, 0, 3, 3, 3, 5, 3, 1, 1, 0} will be described. 1 In the Spreadsheet Window, (1) select the Variable tap to bring up the Variable Tool Bar and (2) click Add-variable ( ) button to create a new row with Name = Variable1 as shown below. 2 In the Spreadsheet Window, set the Name field to k and click 0 rows button to bring up the Initial Values window with a default value of 0. When the type of the variable is not integer, its type is selected from the fold-down menu as shown below. 3 At the Variable Tool Bar, Click Add-variable ( = Variable2 as shown below. ) button to append a row with Name 9

10 4 In the Spreadsheet Window, (1) set Name to N, (2) set Columns to 12 (Rows and Type are not changed), (3) click 0 rows button to bring up the Initial Values window having 12 columns, and (4) set the entries of the Initial Values window to the given initials values as shown below. 4. Modeling with Canceling Arcs In Chapter 10 ( 10.3) of the textbook, it was shown that the use of the canceling arc in an ACD proved to be quite convenient when modeling reneging, resource failures, and time-constrained processing. The canceling arc in ACD is denoted by a circle-tailed arrow, which indicates that whenever the originating activity is completed, the target activity is canceled if it is active. How to model an ACD with canceling arcs using ACE will be described with the ACD in Fig of the textbook and it s ATT given below. In this single server system with reneging, the customers waiting for a service in a line may leave if they have waited more than Uni(10,15) minutes. 10

11 First step is to build an ATT (see below) from the above input ATT by following the ACE program building procedure described in Section 2 of this tutorial. Once the ATT is built, the simulation is run by clicking Run Run Options at the Main Menu to open the Run Options dialog box and then specify run options as {EOS time = 500, Random number seed = 12345, and the System Trajectories box marked}: At the Run Options dialog box, click Save & Run to run the simulation. Check the system trajectory of the Output Report. Observe that a Waited event listed in the Future Event List {Created( ), Waited( )} at Clock is canceled by the Processed event where Q=1 > 0 at Clock

12 Also, as time goes by, the queue length at the Q queue increases. Therefore, at a certain time, a job gets started to renege. Observe that at Clock , the Waited event is executed where Q=4 and M=0 (busy), which means that a job waiting at the Q queue will renege the system. 5. Additional Modeling Features 5.1 Random Variate Generation Functions The ACE supports a number of random variate generation functions that can be used in specifying inter-arrival times, service or processing times, etc. As shown in the table below, the supported distribution functions are Normal, Beta, Exponential, Weibull, Erlang, Student-T, Uniform, and Triangular. All the random variate generation functions return a floating point random number. Therefore, the system variable to which the returned value of a random variate generation function is assigned, should be declared as a type double. Probabilistic Distribution Function Description 12

13 Normal normal (μ, σ) Beta beta (α, β) Exponential exp (μ) Weibull weib (α, λ) Erlang erlang (α, λ) Student-T student (ν) uni () Uniform uni (α, β) Triangular tri(α, β, γ) Returns a floating point random number that follows the normal distribution having parameters μ and σ where - < μ <, 0 σ <. Returns a non-negative floating point random number less than or equal to 1.0 with the parameters α and β where 0 < α, β <. Returns a floating point random number that follows the exponential distribution having a parameters μ. Returns a floating point random number that follows the weibull distribution having two parameters α and λ where 0 < α, λ <. Returns a floating point random number that follows the Erlang distribution having two parameters α and λ where 0 < α < and λ {1,2, }. Returns a floating point random number that follows the Erlang distribution having a parameter ν where ν {1,2, }. Returns a non-negative floating point random number less than 1.0; that is, the range of return values includes 0.0 but not 1.0. Returns a floating point random number within the specified range; that is, the range of return values (X) includes α but not β (α X < β). Returns a floating point random number that follows triangular distribution within the specified range; that is, the range of return values include α and β where - < α < β <, α γ β. The random variate generation functions may be utilized as follows: 1 Specifying the BTO-event s time: In the following ATT Window, the BTO-event Time column for the activity Create is specified with the random variate generation function, Exp(15) or alternatively, exp(15). All the random variate generation function may start with a capital letter, but the rest should be lower case letters. 2 Assigning a random value to a system variable in the At-begin/At-end Actions Prior to assign a random value to a system variable, the system variable should be declared (as type double ). In the following Spreadsheet Window, the system variable U is declared as a type of double. 13

14 Then, in the following ATT Window, the At-begin Action of the activity Inspect is to assign a uniform random number to a system variable U, namely, U = Uni(0, 1), in order for a probabilistic branching. 5.2 Syntax for Specifying Conditions and Actions When specifying At-begin/At-end Conditions/Actions, the syntax described in the following should be used (Mostly, it follows the syntax of Microsoft C# programming language. Please, refer to the C# Programmer s Reference located at MSDN website). 1 Naming of a Variable or Queue The name of a queue or a variable should begin with a letter that could be followed by a sequence of letters, digits (0-9) or underscore. The first character cannot be a digit. The name of a queue or a variable must not contain any embedded space or symbol like? - # % ^ & ( ) [ ] { }. ; : / and \. 2 Operators The following operators are permitted to use in the conditions and actions. Operator category Operators Description Arithmetic + Add two operands: A + B - Subtract seconds operand from the first: A - B * Multiply both operands: A * B / Divide numerator by de-numerator: B / A % Computes the remainder after dividing its first operand by its second: A % B 14

15 Logical Increment/decrement Relational Assignment && Logical AND of its bool operands: A && B (true or false) Logical-OR of its bool operands: A B (true or false)! Negates its operand:!a (true if A is false, false if A is true) ++ Increase integer value by one: A++ -- Decrease integer value by one: A-- == Returns true if the values of tis operands are equal, false otherwise: A == B!= Returns false if its operands are equal, true otherwise: A!= B <,>,<=,>= = += A += B is equal to A = A + B -= A -= B is equal to A = A B *= A *= B is equal to A = A * B /= A /= B is equal to A = A / B %= A %= B is equal to A = A % B Less than, greater than, less than or equal, greater than or equal operators. Stores the value of its right-hand operand to the left-hand operand: A = B 3 Statements When specifying At-begin/At-end Actions, each statement should end with a semicolon ; to separate the statements. The semicolon at the end of a last statement of an Action may be omitted. For example, the following actions are all valid: A-- A--; P1--; M1--; When specifying the Influence Activity column, the adjacent activities should be separated by a comma,. The syntax of the conditional statement if-else in an Action follows that of the C# language, as can be seen in the following example. 15

16 In the ATT Window given below, a type casting operator is used to prevent illegal type casting error. The type of the variable k is integer, but the type of the right-hand side operand (Clock / 120) double. Therefore, an explicit type cast from double-type to integer-type using (int) is enforced in the statement. 4 Array Variable The ACE supports array-type variables. In order to access an element of an array-type variable, the symbol [] is used to give a specific position of the element. If the variable is a two-dimensional array, [][] is used. In the ATT Window given below, the variables N and R are declared as array-type variables (Remember that a onedimensional array should have 1 for Rows column). For example, the 5 th element of the variable N can be accessed via N[4] because the array index starts from zero. 16

A Guide to a Dedicated Event Graph Simulator for a Single Server System. October, 2013 Byoung K. Choi and Donghun Kang

A Guide to a Dedicated Event Graph Simulator for a Single Server System. October, 2013 Byoung K. Choi and Donghun Kang A Guide to a Dedicated Event Graph Simulator for a Single Server System October, 2013 Byoung K. Choi and Donghun Kang Objective This document provides a guide to the single-server system event-graph simulator

More information

Computer Programming : C++

Computer Programming : C++ The Islamic University of Gaza Engineering Faculty Department of Computer Engineering Fall 2017 ECOM 2003 Muath i.alnabris Computer Programming : C++ Experiment #1 Basics Contents Structure of a program

More information

Simulation Modelling Practice and Theory

Simulation Modelling Practice and Theory Simulation Modelling Practice and Theory 19 (2011) 785 800 Contents lists available at ScienceDirect Simulation Modelling Practice and Theory journal homepage: www.elsevier.com/locate/simpat The extended

More information

BASIC ELEMENTS OF A COMPUTER PROGRAM

BASIC ELEMENTS OF A COMPUTER PROGRAM BASIC ELEMENTS OF A COMPUTER PROGRAM CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING LOGO Contents 1 Identifier 2 3 Rules for naming and declaring data variables Basic data types 4 Arithmetic operators

More information

Review: Exam 1. Your First C++ Program. Declaration Statements. Tells the compiler. Examples of declaration statements

Review: Exam 1. Your First C++ Program. Declaration Statements. Tells the compiler. Examples of declaration statements Review: Exam 1 9/20/06 CS150 Introduction to Computer Science 1 1 Your First C++ Program 1 //*********************************************************** 2 // File name: hello.cpp 3 // Author: Shereen Khoja

More information

Overview: Programming Concepts. Programming Concepts. Names, Values, And Variables

Overview: Programming Concepts. Programming Concepts. Names, Values, And Variables Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript Fluency with Information Technology Third Edition by Lawrence Snyder Overview: Programming Concepts Programming: Act of formulating

More information

Overview: Programming Concepts. Programming Concepts. Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript

Overview: Programming Concepts. Programming Concepts. Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript Fluency with Information Technology Third Edition by Lawrence Snyder Overview: Programming Concepts Programming: Act of formulating

More information

CSc 10200! Introduction to Computing. Lecture 2-3 Edgardo Molina Fall 2013 City College of New York

CSc 10200! Introduction to Computing. Lecture 2-3 Edgardo Molina Fall 2013 City College of New York CSc 10200! Introduction to Computing Lecture 2-3 Edgardo Molina Fall 2013 City College of New York 1 C++ for Engineers and Scientists Third Edition Chapter 2 Problem Solving Using C++ 2 Objectives In this

More information

Fundamentals of Programming

Fundamentals of Programming Fundamentals of Programming Lecture 3 - Constants, Variables, Data Types, And Operations Lecturer : Ebrahim Jahandar Borrowed from lecturer notes by Omid Jafarinezhad Outline C Program Data types Variables

More information

SIGMA Tutorial. March, 2013 VMS Technology, Inc.

SIGMA Tutorial. March, 2013 VMS Technology, Inc. SIGMA Tutorial March, 2013 VMS Technology, Inc. This SIGMA tutorial aims to provide a minimum but sufficient guide for a beginner to get started with SIGMA. For more details, the reader is recommended

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

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language 1 History C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell Labs. C was originally first implemented on the DEC

More information

LECTURE 3 C++ Basics Part 2

LECTURE 3 C++ Basics Part 2 LECTURE 3 C++ Basics Part 2 OVERVIEW Operators Type Conversions OPERATORS Operators are special built-in symbols that have functionality, and work on operands. Operators are actually functions that use

More information

Introduction to C# Applications

Introduction to C# Applications 1 2 3 Introduction to C# Applications OBJECTIVES To write simple C# applications To write statements that input and output data to the screen. To declare and use data of various types. To write decision-making

More information

Fundamental of Programming (C)

Fundamental of Programming (C) Borrowed from lecturer notes by Omid Jafarinezhad Fundamental of Programming (C) Lecturer: Vahid Khodabakhshi Lecture 3 Constants, Variables, Data Types, And Operations Department of Computer Engineering

More information

Unit-II Programming and Problem Solving (BE1/4 CSE-2)

Unit-II Programming and Problem Solving (BE1/4 CSE-2) Unit-II Programming and Problem Solving (BE1/4 CSE-2) Problem Solving: Algorithm: It is a part of the plan for the computer program. An algorithm is an effective procedure for solving a problem in a finite

More information

x = 3 * y + 1; // x becomes 3 * y + 1 a = b = 0; // multiple assignment: a and b both get the value 0

x = 3 * y + 1; // x becomes 3 * y + 1 a = b = 0; // multiple assignment: a and b both get the value 0 6 Statements 43 6 Statements The statements of C# do not differ very much from those of other programming languages. In addition to assignments and method calls there are various sorts of selections and

More information

Programming Lecture 3

Programming Lecture 3 Programming Lecture 3 Expressions (Chapter 3) Primitive types Aside: Context Free Grammars Constants, variables Identifiers Variable declarations Arithmetic expressions Operator precedence Assignment statements

More information

LESSON 1. A C program is constructed as a sequence of characters. Among the characters that can be used in a program are:

LESSON 1. A C program is constructed as a sequence of characters. Among the characters that can be used in a program are: LESSON 1 FUNDAMENTALS OF C The purpose of this lesson is to explain the fundamental elements of the C programming language. C like other languages has all alphabet and rules for putting together words

More information

Introduction to MATLAB

Introduction to MATLAB CHEE MATLAB Tutorial Introduction to MATLAB Introduction In this tutorial, you will learn how to enter matrices and perform some matrix operations using MATLAB. MATLAB is an interactive program for numerical

More information

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University Unit 1 Programming Language and Overview of C 1. State whether the following statements are true or false. a. Every line in a C program should end with a semicolon. b. In C language lowercase letters are

More information

SMURF Language Reference Manual Serial MUsic Represented as Functions

SMURF Language Reference Manual Serial MUsic Represented as Functions SMURF Language Reference Manual Serial MUsic Represented as Functions Richard Townsend, Lianne Lairmore, Lindsay Neubauer, Van Bui, Kuangya Zhai {rt2515, lel2143, lan2135, vb2363, kz2219}@columbia.edu

More information

Chapter 2: Using Data

Chapter 2: Using Data Chapter 2: Using Data Declaring Variables Constant Cannot be changed after a program is compiled Variable A named location in computer memory that can hold different values at different points in time

More information

PRG PROGRAMMING ESSENTIALS. Lecture 2 Program flow, Conditionals, Loops

PRG PROGRAMMING ESSENTIALS. Lecture 2 Program flow, Conditionals, Loops PRG PROGRAMMING ESSENTIALS 1 Lecture 2 Program flow, Conditionals, Loops https://cw.fel.cvut.cz/wiki/courses/be5b33prg/start Michal Reinštein Czech Technical University in Prague, Faculty of Electrical

More information

9. Elementary Algebraic and Transcendental Scalar Functions

9. Elementary Algebraic and Transcendental Scalar Functions Scalar Functions Summary. Introduction 2. Constants 2a. Numeric Constants 2b. Character Constants 2c. Symbol Constants 2d. Nested Constants 3. Scalar Functions 4. Arithmetic Scalar Functions 5. Operators

More information

CS313D: ADVANCED PROGRAMMING LANGUAGE

CS313D: ADVANCED PROGRAMMING LANGUAGE CS313D: ADVANCED PROGRAMMING LANGUAGE Computer Science department Lecture 2 : C# Language Basics Lecture Contents 2 The C# language First program Variables and constants Input/output Expressions and casting

More information

The C++ Language. Arizona State University 1

The C++ Language. Arizona State University 1 The C++ Language CSE100 Principles of Programming with C++ (based off Chapter 2 slides by Pearson) Ryan Dougherty Arizona State University http://www.public.asu.edu/~redoughe/ Arizona State University

More information

Visual C# Instructor s Manual Table of Contents

Visual C# Instructor s Manual Table of Contents Visual C# 2005 2-1 Chapter 2 Using Data At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class Discussion Topics Additional Projects Additional Resources Key Terms

More information

GOLD Language Reference Manual

GOLD Language Reference Manual GOLD Language Reference Manual Language Guru: Timothy E. Chung (tec2123) System Architect: Aidan Rivera (ar3441) Manager: Zeke Reyna (eer2138) Tester: Dennis Guzman (drg2156) October 16th, 2017 1 Introduction

More information

BTE2313. Chapter 2: Introduction to C++ Programming

BTE2313. Chapter 2: Introduction to C++ Programming For updated version, please click on http://ocw.ump.edu.my BTE2313 Chapter 2: Introduction to C++ Programming by Sulastri Abdul Manap Faculty of Engineering Technology sulastri@ump.edu.my Objectives In

More information

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program Objectives Chapter 2: Basic Elements of C++ In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates

More information

Contents. Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual

Contents. Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual Contents 1 Introduction...2 2 Lexical Conventions...2 3 Types...3 4 Syntax...3 5 Expressions...4 6 Declarations...8 7 Statements...9

More information

Fundamentals. Fundamentals. Fundamentals. We build up instructions from three types of materials

Fundamentals. Fundamentals. Fundamentals. We build up instructions from three types of materials Fundamentals We build up instructions from three types of materials Constants Expressions Fundamentals Constants are just that, they are values that don t change as our macros are executing Fundamentals

More information

Chapter 2: Basic Elements of C++

Chapter 2: Basic Elements of C++ Chapter 2: Basic Elements of C++ Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates

More information

Chapter 2: Basic Elements of C++ Objectives. Objectives (cont d.) A C++ Program. Introduction

Chapter 2: Basic Elements of C++ Objectives. Objectives (cont d.) A C++ Program. Introduction Chapter 2: Basic Elements of C++ C++ Programming: From Problem Analysis to Program Design, Fifth Edition 1 Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers

More information

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture 04 Programs with IO and Loop We will now discuss the module 2,

More information

Lecture 3 Tao Wang 1

Lecture 3 Tao Wang 1 Lecture 3 Tao Wang 1 Objectives In this chapter, you will learn about: Arithmetic operations Variables and declaration statements Program input using the cin object Common programming errors C++ for Engineers

More information

CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University

CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University CS5000: Foundations of Programming Mingon Kang, PhD Computer Science, Kennesaw State University Overview of Source Code Components Comments Library declaration Classes Functions Variables Comments Can

More information

2.1. Chapter 2: Parts of a C++ Program. Parts of a C++ Program. Introduction to C++ Parts of a C++ Program

2.1. Chapter 2: Parts of a C++ Program. Parts of a C++ Program. Introduction to C++ Parts of a C++ Program Chapter 2: Introduction to C++ 2.1 Parts of a C++ Program Copyright 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 2-1 Parts of a C++ Program Parts of a C++ Program // sample C++ program

More information

CSE 1001 Fundamentals of Software Development 1. Identifiers, Variables, and Data Types Dr. H. Crawford Fall 2018

CSE 1001 Fundamentals of Software Development 1. Identifiers, Variables, and Data Types Dr. H. Crawford Fall 2018 CSE 1001 Fundamentals of Software Development 1 Identifiers, Variables, and Data Types Dr. H. Crawford Fall 2018 Identifiers, Variables and Data Types Reserved Words Identifiers in C Variables and Values

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

CT 229. Java Syntax 26/09/2006 CT229

CT 229. Java Syntax 26/09/2006 CT229 CT 229 Java Syntax 26/09/2006 CT229 Lab Assignments Assignment Due Date: Oct 1 st Before submission make sure that the name of each.java file matches the name given in the assignment sheet!!!! Remember:

More information

I Internal Examination Sept Class: - BCA I Subject: - Principles of Programming Lang. (BCA 104) MM: 40 Set: A Time: 1 ½ Hrs.

I Internal Examination Sept Class: - BCA I Subject: - Principles of Programming Lang. (BCA 104) MM: 40 Set: A Time: 1 ½ Hrs. I Internal Examination Sept. 2018 Class: - BCA I Subject: - Principles of Programming Lang. (BCA 104) MM: 40 Set: A Time: 1 ½ Hrs. [I]Very short answer questions (Max 40 words). (5 * 2 = 10) 1. What is

More information

ARG! Language Reference Manual

ARG! Language Reference Manual ARG! Language Reference Manual Ryan Eagan, Mike Goldin, River Keefer, Shivangi Saxena 1. Introduction ARG is a language to be used to make programming a less frustrating experience. It is similar to C

More information

Unit 3. Operators. School of Science and Technology INTRODUCTION

Unit 3. Operators. School of Science and Technology INTRODUCTION INTRODUCTION Operators Unit 3 In the previous units (unit 1 and 2) you have learned about the basics of computer programming, different data types, constants, keywords and basic structure of a C program.

More information

Expressions. Arithmetic expressions. Logical expressions. Assignment expression. n Variables and constants linked with operators

Expressions. Arithmetic expressions. Logical expressions. Assignment expression. n Variables and constants linked with operators Expressions 1 Expressions n Variables and constants linked with operators Arithmetic expressions n Uses arithmetic operators n Can evaluate to any value Logical expressions n Uses relational and logical

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 programming with Python

Introduction to programming with Python Introduction to programming with Python Ing. Lelio Campanile 1/61 Main Goal - Introduce you to programming - introduce you to the most essential feature of python programming 2/61 Before to start The name

More information

Fundamentals of C Programming

Fundamentals of C Programming Introduction, Constants, variables, keywords, Comments, I/O Functions, Data types, Compilation & Execution Tejalal Choudhary tejalal.choudhary@gmail.com, tejalal.choudhary@sdbct.ac.in Department of Computer

More information

Full file at

Full file at Java Programming, Fifth Edition 2-1 Chapter 2 Using Data within a Program At a Glance Instructor s Manual Table of Contents Overview Objectives Teaching Tips Quick Quizzes Class Discussion Topics Additional

More information

Constraint-based Metabolic Reconstructions & Analysis H. Scott Hinton. Matlab Tutorial. Lesson: Matlab Tutorial

Constraint-based Metabolic Reconstructions & Analysis H. Scott Hinton. Matlab Tutorial. Lesson: Matlab Tutorial 1 Matlab Tutorial 2 Lecture Learning Objectives Each student should be able to: Describe the Matlab desktop Explain the basic use of Matlab variables Explain the basic use of Matlab scripts Explain the

More information

3. Java - Language Constructs I

3. Java - Language Constructs I Educational Objectives 3. Java - Language Constructs I Names and Identifiers, Variables, Assignments, Constants, Datatypes, Operations, Evaluation of Expressions, Type Conversions You know the basic blocks

More information

Introduction. Following are the types of operators: Unary requires a single operand Binary requires two operands Ternary requires three operands

Introduction. Following are the types of operators: Unary requires a single operand Binary requires two operands Ternary requires three operands Introduction Operators are the symbols which operates on value or a variable. It tells the compiler to perform certain mathematical or logical manipulations. Can be of following categories: Unary requires

More information

Course PJL. Arithmetic Operations

Course PJL. Arithmetic Operations Outline Oman College of Management and Technology Course 503200 PJL Handout 5 Arithmetic Operations CS/MIS Department 1 // Fig. 2.9: Addition.java 2 // Addition program that displays the sum of two numbers.

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

Maciej Sobieraj. Lecture 1

Maciej Sobieraj. Lecture 1 Maciej Sobieraj Lecture 1 Outline 1. Introduction to computer programming 2. Advanced flow control and data aggregates Your first program First we need to define our expectations for the program. They

More information

Programming for Engineers Iteration

Programming for Engineers Iteration Programming for Engineers Iteration ICEN 200 Spring 2018 Prof. Dola Saha 1 Data type conversions Grade average example,-./0 class average = 23450-67 893/0298 Grade and number of students can be integers

More information

Data and Variables. Data Types Expressions. String Concatenation Variables Declaration Assignment Shorthand operators. Operators Precedence

Data and Variables. Data Types Expressions. String Concatenation Variables Declaration Assignment Shorthand operators. Operators Precedence Data and Variables Data Types Expressions Operators Precedence String Concatenation Variables Declaration Assignment Shorthand operators Review class All code in a java file is written in a class public

More information

Overview of C. Basic Data Types Constants Variables Identifiers Keywords Basic I/O

Overview of C. Basic Data Types Constants Variables Identifiers Keywords Basic I/O Overview of C Basic Data Types Constants Variables Identifiers Keywords Basic I/O NOTE: There are six classes of tokens: identifiers, keywords, constants, string literals, operators, and other separators.

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

Chapter 2. C++ Basics. Copyright 2014 Pearson Addison-Wesley. All rights reserved.

Chapter 2. C++ Basics. Copyright 2014 Pearson Addison-Wesley. All rights reserved. Chapter 2 C++ Basics 1 Overview 2.1 Variables and Assignments 2.2 Input and Output 2.3 Data Types and Expressions 2.4 Simple Flow of Control 2.5 Program Style Slide 2-3 2.1 Variables and Assignments 2

More information

FRAC: Language Reference Manual

FRAC: Language Reference Manual FRAC: Language Reference Manual Justin Chiang jc4127 Kunal Kamath kak2211 Calvin Li ctl2124 Anne Zhang az2350 1. Introduction FRAC is a domain-specific programming language that enables the programmer

More information

Control Structures. Lecture 4 COP 3014 Fall September 18, 2017

Control Structures. Lecture 4 COP 3014 Fall September 18, 2017 Control Structures Lecture 4 COP 3014 Fall 2017 September 18, 2017 Control Flow Control flow refers to the specification of the order in which the individual statements, instructions or function calls

More information

Chapter 2: Using Data

Chapter 2: Using Data Chapter 2: Using Data TRUE/FALSE 1. A variable can hold more than one value at a time. F PTS: 1 REF: 52 2. The legal integer values are -2 31 through 2 31-1. These are the highest and lowest values that

More information

L-System Fractal Generator: Language Reference Manual

L-System Fractal Generator: Language Reference Manual L-System Fractal Generator: Language Reference Manual Michael Eng, Jervis Muindi, Timothy Sun Contents 1 Program Definition 3 2 Lexical Conventions 3 2.1 Comments...............................................

More information

Chapter-8 DATA TYPES. Introduction. Variable:

Chapter-8 DATA TYPES. Introduction. Variable: Chapter-8 DATA TYPES Introduction To understand any programming languages we need to first understand the elementary concepts which form the building block of that program. The basic building blocks include

More information

DaMPL. Language Reference Manual. Henrique Grando

DaMPL. Language Reference Manual. Henrique Grando DaMPL Language Reference Manual Bernardo Abreu Felipe Rocha Henrique Grando Hugo Sousa bd2440 flt2107 hp2409 ha2398 Contents 1. Getting Started... 4 2. Syntax Notations... 4 3. Lexical Conventions... 4

More information

Chapter 12 Variables and Operators

Chapter 12 Variables and Operators Chapter 12 Variables and Operators Highlights (1) r. height width operator area = 3.14 * r *r + width * height literal/constant variable expression (assignment) statement 12-2 Highlights (2) r. height

More information

(Not Quite) Minijava

(Not Quite) Minijava (Not Quite) Minijava CMCS22620, Spring 2004 April 5, 2004 1 Syntax program mainclass classdecl mainclass class identifier { public static void main ( String [] identifier ) block } classdecl class identifier

More information

Programming in C++ 6. Floating point data types

Programming in C++ 6. Floating point data types Programming in C++ 6. Floating point data types! Introduction! Type double! Type float! Changing types! Type promotion & conversion! Casts! Initialization! Assignment operators! Summary 1 Introduction

More information

Basics of Java Programming

Basics of Java Programming Basics of Java Programming Lecture 2 COP 3252 Summer 2017 May 16, 2017 Components of a Java Program statements - A statement is some action or sequence of actions, given as a command in code. A statement

More information

Chapter 2 Using Data. Instructor s Manual Table of Contents. At a Glance. Overview. Objectives. Teaching Tips. Quick Quizzes. Class Discussion Topics

Chapter 2 Using Data. Instructor s Manual Table of Contents. At a Glance. Overview. Objectives. Teaching Tips. Quick Quizzes. Class Discussion Topics Java Programming, Sixth Edition 2-1 Chapter 2 Using Data At a Glance Instructor s Manual Table of Contents Overview Objectives Teaching Tips Quick Quizzes Class Discussion Topics Additional Projects Additional

More information

PLT Fall Shoo. Language Reference Manual

PLT Fall Shoo. Language Reference Manual PLT Fall 2018 Shoo Language Reference Manual Claire Adams (cba2126) Samurdha Jayasinghe (sj2564) Rebekah Kim (rmk2160) Cindy Le (xl2738) Crystal Ren (cr2833) October 14, 2018 Contents 1 Comments 2 1.1

More information

The Arithmetic Operators. Unary Operators. Relational Operators. Examples of use of ++ and

The Arithmetic Operators. Unary Operators. Relational Operators. Examples of use of ++ and The Arithmetic Operators The arithmetic operators refer to the standard mathematical operators: addition, subtraction, multiplication, division and modulus. Op. Use Description + x + y adds x and y x y

More information

The Arithmetic Operators

The Arithmetic Operators The Arithmetic Operators The arithmetic operators refer to the standard mathematical operators: addition, subtraction, multiplication, division and modulus. Examples: Op. Use Description + x + y adds x

More information

Arrays. Defining arrays, declaration and initialization of arrays. Designed by Parul Khurana, LIECA.

Arrays. Defining arrays, declaration and initialization of arrays. Designed by Parul Khurana, LIECA. Arrays Defining arrays, declaration and initialization of arrays Introduction Many applications require the processing of multiple data items that have common characteristics (e.g., a set of numerical

More information

Full file at C How to Program, 6/e Multiple Choice Test Bank

Full file at   C How to Program, 6/e Multiple Choice Test Bank 2.1 Introduction 2.2 A Simple Program: Printing a Line of Text 2.1 Lines beginning with let the computer know that the rest of the line is a comment. (a) /* (b) ** (c) REM (d)

More information

C++ Programming: From Problem Analysis to Program Design, Third Edition

C++ Programming: From Problem Analysis to Program Design, Third Edition C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 2: Basic Elements of C++ Objectives (continued) Become familiar with the use of increment and decrement operators Examine

More information

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards Language Reference Manual Introduction The purpose of

More information

The SPL Programming Language Reference Manual

The SPL Programming Language Reference Manual The SPL Programming Language Reference Manual Leonidas Fegaras University of Texas at Arlington Arlington, TX 76019 fegaras@cse.uta.edu February 27, 2018 1 Introduction The SPL language is a Small Programming

More information

2. Distinguish between a unary, a binary and a ternary operator. Give examples of C++ operators for each one of them.

2. Distinguish between a unary, a binary and a ternary operator. Give examples of C++ operators for each one of them. 1. Why do you think C++ was not named ++C? C++ is a super set of language C. All the basic features of C are used in C++ in their original form C++ can be described as C+ some additional features. Therefore,

More information

Data Types, Variables and Arrays. OOC 4 th Sem, B Div Prof. Mouna M. Naravani

Data Types, Variables and Arrays. OOC 4 th Sem, B Div Prof. Mouna M. Naravani Data Types, Variables and Arrays OOC 4 th Sem, B Div 2016-17 Prof. Mouna M. Naravani Identifiers in Java Identifiers are the names of variables, methods, classes, packages and interfaces. Identifiers must

More information

Operators in C. Staff Incharge: S.Sasirekha

Operators in C. Staff Incharge: S.Sasirekha Operators in C Staff Incharge: S.Sasirekha Operators An operator is a symbol which helps the user to command the computer to do a certain mathematical or logical manipulations. Operators are used in C

More information

DEPARTMENT OF MATHS, MJ COLLEGE

DEPARTMENT OF MATHS, MJ COLLEGE T. Y. B.Sc. Mathematics MTH- 356 (A) : Programming in C Unit 1 : Basic Concepts Syllabus : Introduction, Character set, C token, Keywords, Constants, Variables, Data types, Symbolic constants, Over flow,

More information

Arithmetic Operators. Binary Arithmetic Operators. Arithmetic Operators. A Closer Look at the / Operator. A Closer Look at the % Operator

Arithmetic Operators. Binary Arithmetic Operators. Arithmetic Operators. A Closer Look at the / Operator. A Closer Look at the % Operator 1 A Closer Look at the / Operator Used for performing numeric calculations C++ has unary, binary, and ternary s: unary (1 operand) - binary ( operands) 13-7 ternary (3 operands) exp1? exp : exp3 / (division)

More information

Chapter 12 Variables and Operators

Chapter 12 Variables and Operators Basic C Elements Chapter 12 Variables and Operators Original slides from Gregory Byrd, North Carolina State University! Variables named, typed data items! Operators predefined actions performed on data

More information

Chapter 2: Introduction to C++

Chapter 2: Introduction to C++ Chapter 2: Introduction to C++ Copyright 2010 Pearson Education, Inc. Copyright Publishing as 2010 Pearson Pearson Addison-Wesley Education, Inc. Publishing as Pearson Addison-Wesley 2.1 Parts of a C++

More information

1.3b Type Conversion

1.3b Type Conversion 1.3b Type Conversion Type Conversion When we write expressions involved data that involves two different data types, such as multiplying an integer and floating point number, we need to perform a type

More information

Chapter 2: Special Characters. Parts of a C++ Program. Introduction to C++ Displays output on the computer screen

Chapter 2: Special Characters. Parts of a C++ Program. Introduction to C++ Displays output on the computer screen Chapter 2: Introduction to C++ 2.1 Parts of a C++ Program Copyright 2009 Pearson Education, Inc. Copyright 2009 Publishing Pearson as Pearson Education, Addison-Wesley Inc. Publishing as Pearson Addison-Wesley

More information

CSCE 120: Learning To Code

CSCE 120: Learning To Code CSCE 120: Learning To Code Manipulating Data I Introduction This module is designed to get you started working with data by understanding and using variables and data types in JavaScript. It will also

More information

C++ Basic Elements of COMPUTER PROGRAMMING. Special symbols include: Word symbols. Objectives. Programming. Symbols. Symbols.

C++ Basic Elements of COMPUTER PROGRAMMING. Special symbols include: Word symbols. Objectives. Programming. Symbols. Symbols. EEE-117 COMPUTER PROGRAMMING Basic Elements of C++ Objectives General Questions Become familiar with the basic components of a C++ program functions, special symbols, and identifiers Data types Arithmetic

More information

XSEDE Scholars Program Introduction to C Programming. John Lockman III June 7 th, 2012

XSEDE Scholars Program Introduction to C Programming. John Lockman III June 7 th, 2012 XSEDE Scholars Program Introduction to C Programming John Lockman III June 7 th, 2012 Homework 1 Problem 1 Find the error in the following code #include int main(){ } printf(find the error!\n");

More information

COMP Primitive and Class Types. Yi Hong May 14, 2015

COMP Primitive and Class Types. Yi Hong May 14, 2015 COMP 110-001 Primitive and Class Types Yi Hong May 14, 2015 Review What are the two major parts of an object? What is the relationship between class and object? Design a simple class for Student How to

More information

CSI33 Data Structures

CSI33 Data Structures Outline Department of Mathematics and Computer Science Bronx Community College October 24, 2018 Outline Outline 1 Chapter 8: A C++ Introduction For Python Programmers Expressions and Operator Precedence

More information

CS112 Lecture: Variables, Expressions, Computation, Constants, Numeric Input-Output

CS112 Lecture: Variables, Expressions, Computation, Constants, Numeric Input-Output CS112 Lecture: Variables, Expressions, Computation, Constants, Numeric Input-Output Last revised January 12, 2006 Objectives: 1. To introduce arithmetic operators and expressions 2. To introduce variables

More information

Ordinary Differential Equation Solver Language (ODESL) Reference Manual

Ordinary Differential Equation Solver Language (ODESL) Reference Manual Ordinary Differential Equation Solver Language (ODESL) Reference Manual Rui Chen 11/03/2010 1. Introduction ODESL is a computer language specifically designed to solve ordinary differential equations (ODE

More information

Senet. Language Reference Manual. 26 th October Lilia Nikolova Maxim Sigalov Dhruvkumar Motwani Srihari Sridhar Richard Muñoz

Senet. Language Reference Manual. 26 th October Lilia Nikolova Maxim Sigalov Dhruvkumar Motwani Srihari Sridhar Richard Muñoz Senet Language Reference Manual 26 th October 2015 Lilia Nikolova Maxim Sigalov Dhruvkumar Motwani Srihari Sridhar Richard Muñoz 1. Overview Past projects for Programming Languages and Translators have

More information

Chapter 2. C++ Basics. Copyright 2014 Pearson Addison-Wesley. All rights reserved.

Chapter 2. C++ Basics. Copyright 2014 Pearson Addison-Wesley. All rights reserved. Chapter 2 C++ Basics Overview 2.1 Variables and Assignments 2.2 Input and Output 2.3 Data Types and Expressions 2.4 Simple Flow of Control 2.5 Program Style 3 2.1 Variables and Assignments Variables and

More information

Chapter 2. C++ Basics

Chapter 2. C++ Basics Chapter 2 C++ Basics Overview 2.1 Variables and Assignments 2.2 Input and Output 2.3 Data Types and Expressions 2.4 Simple Flow of Control 2.5 Program Style Slide 2-2 2.1 Variables and Assignments Variables

More information

Chapter Overview. C++ Basics. Variables and Assignments. Variables and Assignments. Keywords. Identifiers. 2.1 Variables and Assignments

Chapter Overview. C++ Basics. Variables and Assignments. Variables and Assignments. Keywords. Identifiers. 2.1 Variables and Assignments Chapter 2 C++ Basics Overview 2.1 Variables and Assignments 2.2 Input and Output 2.3 Data Types and Expressions 2.4 Simple Flow of Control 2.5 Program Style Copyright 2011 Pearson Addison-Wesley. All rights

More information