Chapter 4 C Program Control

Size: px
Start display at page:

Download "Chapter 4 C Program Control"

Transcription

1 Chapter 4 C Program Control 1 Outline 4.1 Introduction 4.2 The Essentials of Repetition 4.3 Counter-Controlled Repetition 4.4 The for Repetition Statement 4.5 The for Statement: Notes and Observations 4.6 Examples Using the for Statement 4.7 The switch Multiple-Selection Statement 4.8 The do while Repetition Statement 4.9 The break and continue Statements 4.10 Logical Operators 4.11 Confusing Equality (==) and Assignment (=) Operators 4.12 Structured Programming Summary Objectives 2 In this chapter, you will learn: To be able to use thefor anddo while repetition statements. To understand multiple selection using the switch selection statement. To be able to use thebreak andcontinue program control statements To be able to use the logical operators. 1

2 3 This chapter introduces 4.1 Introduction Additional repetition control structures for Do while switch multiple selection statement break statement Used for exiting immediately and rapidly from certain control structures continue statement Used for skipping the remainder of the body of a repetition structure and proceeding with the next iteration of the loop The Essentials of Repetition Loop ( 迴圈 ) Group of instructions computer executes repeatedly while some condition remainstrue Counter-controlled repetition Definite repetition: know how many times loop will execute Control variable used to count repetitions Sentinel-controlled repetition Indefinite repetition Used when number of repetitions not known Sentinel value indicates "end of data" 2

3 4.3 Essentials of Counter-Controlled Repetition Counter-controlled repetition requires The name of a control variable (or loop counter) The initial value of the control variable An increment (or decrement) by which the control variable is modified each time through the loop A condition that tests for the final value of the control variable (i.e., whether looping should continue) int i = 0; 5 while (i <= 10) { i = i + 1; } 4.3 Essentials of Counter-Controlled Repetition Example: int counter = 1; // initialization while ( counter <= 10 ) { // repetition condition printf( "%d\n", counter ); ++counter; // increment } The statement int counter = 1; Namescounter Defines it to be an integer Reserves space for it in memory Sets it to an initial value of1 6 3

4 The Flow Chart ofwhile 7 int counter = 1; // initialization while ( counter <= 10 ) { // repetition condition printf( "%d\n", counter ); ++counter; // increment } counter = 1 counter <= 10? no ++counter yes printf exit loop 1 /* Fig. 4.1: fig04_01.c 2 Counter-controlled repetition */ 3 #include <stdio.h> 4 5 /* function main begins program execution */ 6 int main() 7 { 8 int counter = 1; /* initialization */ while ( counter <= 10 ) { /* repetition condition 6 */ 11 printf ( "%d\n", counter ); /* display counter */ counter; /* increment */ 8 13 } /* end while */ return 0; /* indicate program ended successfully */ } /* end function main */

5 4.3 Essentials of Counter-Controlled Repetition Condensed code C Programmers would make the program more concise 9 Int counter = 0; while ( ++counter <= 10 ) printf( %d\n, counter ); counter = 0 ++counter counter <= 10? yes no printf exit loop 10 Condensed Code (II) Int counter = 0; while (counter++ <= 9 ) printf( %d\n, counter ); counter = 0 printf counter <= 9? yes counter++ no counter++ exit loop 5

6 Thefor Repetition Statement counter = 1 counter <= 10? no ++counter yes Loop body exit loop Thefor Repetition Statement Format when usingfor loops for ( initialization; loopcontinuationtest; increment ) statement Example: for( int counter = 1; counter <= 10; counter++ ) printf( "%d\n", counter ); Prints the integers from one to ten initialization Loop test no No semicolon (;) after last expression increment yes statement exit loop 6

7 13 Initialization and increment Can be comma-separated lists Example: for (int i = 0, j = 0; j + i <= 10; j++, i++) printf( "%d\n", j + i ); Thefor Repetition Statement For loops can usually be rewritten as while loops: initialization; while ( loopcontinuationtest ){ statement; increment; } for ( int counter = 1; counter <= 10; counter++ ) printf( "%d\n", counter ); counter = 1; while ( counter <= 10 ) { printf( "%d\n", counter ); counter++; } 7

8 1 /* Fig. 4.2: fig04_02.c 2 Counter-controlled repetition with the for statement */ 3 #include <stdio.h> 4 5 /* function main begins program execution */ 6 int main() 7 { 8 int counter; /* define counter */ 9 10 /* initialization, repetition condition, and increment 11 are all included in the for statement header. */ 12 for ( counter = 1; counter <= 10; counter++ ) { 13 printf( "%d\n", counter ); 14 } /* end for */ return 0; /* indicate program ended successfully */ } /* end function main */ 16 Flowchart Establish initial value of control variable counter = 1 Determine if final value of control variable has been reached counter <= 10 false true printf( "%d", counter ); Body of loop (this may be many statements) counter++ Increment the control variable 8

9 17 練習一 設計一段程式, 要求使用者輸入一個整數 N, 輸出 N 的結果 提示 : 使用 for 敘述 1 /* Fig. 4.5: fig04_05.c 2 Summation with for */ 3 #include <stdio.h> 4 5 /* function main begins program execution */ Program Output 6 int main() Sum is { 8 int sum = 0; /* initialize sum */ 9 int number; /* number to be added to sum */ for ( number = 2; number <= 100; number += 2 ) { 12 sum += number; /* add number to sum */ 13 } /* end for */ printf( "Sum is %d\n", sum ); /* output sum */ return 0; /* indicate program ended successfully */ } /* end function main */ 9

10 19 練習二 設計一段程式, 要求使用者輸入一個整數 N, 輸出所有介於 1 與 N 間 ( 不大於 N) 的所有除以 6 餘 4 的數字, 並輸出這樣的數字有多少個 提示 : 使用 for 敘述 20 Practice 寫一個 C 語言程式, 讓使用者輸入一個介於 1 至 100 間的奇數 使用一個 for 或 while 迴圈計算並輸出下列結果 (1) 從 1 至此數字的全部奇數總和 (2) 從 1 至此數字總共有幾個奇數 執行範例 Input an odd number: = 64 There are total 8 odd numbers from 1 to

11 1 /* Fig. 4.6: fig04_06.c 2 Calculating compound interest */ 3 #include <stdio.h> 4 #include <math.h> 5 6 /* function main begins program execution */ 7 int main() 8 { 9 double amount; /* amount on deposit */ 10 double principal = ; /* starting principal */ 11 double rate =.05; /* interest rate */ 12 int year; /* year counter */ /* output table column head */ 15 printf( "%4s%21s\n", "Year", "Amount on deposit" ); fig04_06.c (Part 1 of 2) /* calculate amount on deposit for each of ten years */ 18 for ( year = 1; year <= 10; year++ ) { /* calculate new amount for specified year */ 21 amount = principal * pow( rate, year ); /* output one table row */ = (1+rate) year printf( "%4d%21.2f\n", year, amount ); 25 } /* end for */ fig04_06.c (Part 2 of 2) Program Output 27 return 0; /* indicate program ended successfully Year */ } /* end function main */ Amount on deposit

12 練習三 23 設計一段程式, 要求使用者輸入一個整數 N, 輸出下列運算的結果 : N 提示 : 使用兩層的 for 敘述 Thefor Statement : Notes and Observations Arithmetic expressions Initialization, loop-continuation, and increment can contain arithmetic expressions. Ifxequals2andyequals 10 for ( j = x; j <= 4 * x * y; j += y / x ) 24 is equivalent to for ( j = 2; j <= 80; j += 5 ) 12

13 25 Notes about thefor statement Increment may be negative (decrement) for ( int counter = 10; counter > 0; counter-- ) printf( "%d\n", counter ); Notes about thefor statement If the loop continuation condition is initially false The body of thefor statement is not performed Control proceeds with the next statement after thefor statement for ( int counter = 10; counter < 0; counter++ ) printf( "%d\n", counter ); Control variable Often printed or used inside for body, but not necessary 13

14 4.7 Theswitch Multiple-Selection Statement switch Useful when a variable or expression is tested for all the values it can assume and different actions are taken Format Series ofcase labels and an optionaldefault case switch ( value ){ case '1': actions case '2': actions default: actions } break; exits from statement 27 Flowchart of theswitch statement 28 true case a case a action(s) break false true case b case b action(s) break false... true case z case z action(s) break false default action(s) 14

15 1 /* Fig. 4.7: fig04_07.c 2 Counting letter grades */ 3 #include <stdio.h> 4 5 /* function main begins program execution */ 6 int main() 7 { 8 int grade; /* one grade */ 9 int acount = 0; /* number of As */ 10 int bcount = 0; /* number of Bs */ 11 int ccount = 0; /* number of Cs */ 12 int dcount = 0; /* number of Ds */ 13 int fcount = 0; /* number of Fs */ printf( "Enter the letter grades.\n" ); 16 printf( "Enter the EOF character to end input.\n" ); /* loop until user types end-of-file key sequence */ 19 while ( ( grade = getchar() )!= EOF ) { fig04_07.c (Part 1 of 3) /* determine which grade was input */ fig04_07.c (Part 2 of 22 switch ( grade ) { /* switch nested in while */ 3) case 'A': /* grade was uppercase A */ case case 'a': 'B': /* or /* lowercase grade wasa uppercase */ B */ acount; case case 'b': 'C': /* /* increment or/* lowercase gradeacount wasb uppercase */ */ C */ break; ++bcount; case /* case 'c': necessary 'D': /* /* increment or/* to lowercase grade exit bcount switch was c */ uppercase */ */ D */ break; 44 ++ccount; case /* case 'd': exit/* 'F': switch /* increment or/* lowercase */ grade ccount wasd uppercase */ */ F */ break; 49 ++dcount; case /* case exit 'f': /* '\n': switch /* increment or/* lowercase */ ignore dcount newlines, f */ */ */ break; 54++fCount; case /* default: exit '\t': /* switch increment /* tabs, /**/ catch */ fcount all other */ characters */ break; case '/* printf( ': exit /* "Incorrect and switch spaces */ letter in input grade */ entered." ); printf( break; " Enter /* exit a new switch grade.\n" */ ); break; /* optional; will exit switch */ 58 } /* end switch */ } /* end while */ 61 15

16 62 /* output summary of results */ 63 printf( "\ntotals for each letter grade are:\n" ); 64 printf( "A: %d\n", acount ); /* display number of A grades */ 65 printf( "B: %d\n", bcount ); /* display number of B grades */ 66 printf( "C: %d\n", ccount ); /* display number of C grades */ 67 printf( "D: %d\n", dcount ); /* display number of D grades */ 68 printf( "F: %d\n", fcount ); /* display number of F grades */ return 0; /* indicate program ended successfully */ } /* end function main */ fig04_07.c (Part 3 of 3) Enter the letter grades. Enter the EOF character to end input. a b c C A d f C E Incorrect letter grade entered. Enter a new grade. D A 按 Ctrl-Z 會使 getchar() 傳回 EOF b ^Z Program Output Totals for each letter grade are: A: 3 B: 2 C: 3 D: 2 F: 1 16

4.8 Thedo while Repetition Statement Thedo while repetition statement

4.8 Thedo while Repetition Statement Thedo while repetition statement 1 4.8 hedo while Repetition Statement hedo while repetition statement Similar to thewhile structure Condition for repetition tested after the body of the loop is performed All actions are performed at

More information

QUIZ-II QUIZ-II. Chapter 5: Control Structures II (Repetition) Objectives. Objectives (cont d.) 20/11/2015. EEE 117 Computer Programming Fall-2015 1

QUIZ-II QUIZ-II. Chapter 5: Control Structures II (Repetition) Objectives. Objectives (cont d.) 20/11/2015. EEE 117 Computer Programming Fall-2015 1 QUIZ-II Write a program that mimics a calculator. The program should take as input two integers and the operation to be performed. It should then output the numbers, the operator, and the result. (For

More information

JavaScript: Control Statements I

JavaScript: Control Statements I 1 7 JavaScript: Control Statements I 7.1 Introduction 2 The techniques you will learn here are applicable to most high-level languages, including JavaScript 1 7.2 Algorithms 3 Any computable problem can

More information

9 Control Statements. 9.1 Introduction. 9.2 Objectives. 9.3 Statements

9 Control Statements. 9.1 Introduction. 9.2 Objectives. 9.3 Statements 9 Control Statements 9.1 Introduction The normal flow of execution in a high level language is sequential, i.e., each statement is executed in the order of its appearance in the program. However, depending

More information

Chemistry I -- Final Exam

Chemistry I -- Final Exam Chemistry I -- Final Exam 01/1/13 Periodic Table of Elements Constants R = 8.314 J / mol K 1 atm = 760 Torr = 1.01x10 5 Pa = 0.081 L atm / K mol c =.9910 8 m/s = 8.314 L kpa / K mol h = 6.6310-34 Js Mass

More information

SHAU KEI WAN GOVERNMENT SECONDARY SCHOOL

SHAU KEI WAN GOVERNMENT SECONDARY SCHOOL 香 港 柴 灣 道 42 號 42 Chai Wan Road, Hong Kong Tel : (852) 2560 3544 Fax : (852) 2568 9708 URL : www.sgss.edu.hk Email : skwgss@edb.gov.hk 筲 箕 灣 官 立 中 學 SHAU KEI WAN GOVERNMENT SECONDARY SCHOOL --------------------------------------------------------------------------------------------------------------------------------

More information

Lecture 1 Introduction to Java

Lecture 1 Introduction to Java Programming Languages: Java Lecture 1 Introduction to Java Instructor: Omer Boyaci 1 2 Course Information History of Java Introduction First Program in Java: Printing a Line of Text Modifying Our First

More information

LC Paper No. PWSC269/15-16(01)

LC Paper No. PWSC269/15-16(01) Legislative Council Public Works Subcommittee meeting on 11 June 2016 118KA Renovation works for the West Wing of the former Central Government Offices for office use by the Department of Justice and law-related

More information

What is a Loop? Pretest Loops in C++ Types of Loop Testing. Count-controlled loops. Loops can be...

What is a Loop? Pretest Loops in C++ Types of Loop Testing. Count-controlled loops. Loops can be... What is a Loop? CSC Intermediate Programming Looping A loop is a repetition control structure It causes a single statement or a group of statements to be executed repeatedly It uses a condition to control

More information

Data Structures Chapter 4 Linked Lists

Data Structures Chapter 4 Linked Lists Data Structures Chapter 4 Linked Lists Instructor: Ching Chi Lin 林 清 池 助 理 教 授 chingchi.lin@gmail.com Department of Computer Science and Engineering National Taiwan Ocean University Outline Singly Linked

More information

Two-way selection. Branching and Looping

Two-way selection. Branching and Looping Control Structures: are those statements that decide the order in which individual statements or instructions of a program are executed or evaluated. Control Structures are broadly classified into: 1.

More information

Installation Guide 2-Port HD Cable KVM Switch with Audio GCS62HU PART NO. M1130

Installation Guide 2-Port HD Cable KVM Switch with Audio GCS62HU PART NO. M1130 Installation Guide 2-Port HD Cable KVM Switch with Audio GCS62HU PART NO. M1130 Table of Contents Package Contents 4 System Requirements 5 Overview 6 Standard Installation 7 Advanced Installation 9 LED

More information

Sources: On the Web: Slides will be available on:

Sources: On the Web: Slides will be available on: C programming Introduction The basics of algorithms Structure of a C code, compilation step Constant, variable type, variable scope Expression and operators: assignment, arithmetic operators, comparison,

More information

Market Access To Taiwan. By Jane Peng TÜV Rheinland Taiwan Ltd.

Market Access To Taiwan. By Jane Peng TÜV Rheinland Taiwan Ltd. Market Access To Taiwan By Jane Peng TÜV Rheinland Taiwan Ltd. Content General Introduction Taiwan BSMI mark Products, Scope and approval scheme News Update TÜV Rheinland s One-Stop Services Contact info.

More information

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection

More information

Introduction to Java Applications. 2005 Pearson Education, Inc. All rights reserved.

Introduction to Java Applications. 2005 Pearson Education, Inc. All rights reserved. 1 2 Introduction to Java Applications 2.2 First Program in Java: Printing a Line of Text 2 Application Executes when you use the java command to launch the Java Virtual Machine (JVM) Sample program Displays

More information

Machine Translation for Academic Purposes

Machine Translation for Academic Purposes Proceedings of the International Conference on TESOL and Translation 2009 December 2009: pp.133-148 Machine Translation for Academic Purposes Grace Hui-chin Lin PhD Texas A&M University College Station

More information

Chapter One Introduction to Programming

Chapter One Introduction to Programming Chapter One Introduction to Programming 1-1 Algorithm and Flowchart Algorithm is a step-by-step procedure for calculation. More precisely, algorithm is an effective method expressed as a finite list of

More information

促 進 市 場 競 爭 加 強 保 障 消 費 者

促 進 市 場 競 爭 加 強 保 障 消 費 者 通 訊 事 務 管 理 局 辦 公 室 2013 14 年 營 運 基 金 報 告 書 5 Facilitating Market Competition and Strengthening Consumer Protection 處 理 和 調 查 有 關 具 誤 導 性 或 欺 騙 性 行 為 的 電 訊 服 務 投 訴 2012 年 商 品 說 明 ( 不 良 營 商 手 法 )( 修 訂 )

More information

EW-7438RPn Mini 安 裝 指 南. 07-2014 / v1.0

EW-7438RPn Mini 安 裝 指 南. 07-2014 / v1.0 EW-7438RPn Mini 安 裝 指 南 07-2014 / v1.0 I. 產 品 資 訊 I-1. 包 裝 內 容 - EW-7438RPn Mini - CD 光 碟 ( 快 速 安 裝 指 南 及 使 用 者 手 冊 ) - 快 速 安 裝 指 南 - 連 線 密 碼 卡 I-2. 系 統 需 求 - 無 線 訊 號 延 伸 / 無 線 橋 接 模 式 : 使 用 現 有 2.4GHz

More information

5.2 Q2 The control variable of a counter-controlled loop should be declared as: a.int. b.float. c.double. d.any of the above. ANS: a. int.

5.2 Q2 The control variable of a counter-controlled loop should be declared as: a.int. b.float. c.double. d.any of the above. ANS: a. int. Java How to Program, 5/e Test Item File 1 of 5 Chapter 5 Section 5.2 5.2 Q1 Counter-controlled repetition requires a.a control variable and initial value. b.a control variable increment (or decrement).

More information

EFL Business Writing with Task-based Learning Approach: A Case Study of Student Strategies to Overcome Difficulties

EFL Business Writing with Task-based Learning Approach: A Case Study of Student Strategies to Overcome Difficulties 2013 年 12 月 ISSN 1815-0373 第 十 卷 第 二 期 P217-238 EFL Business Writing with Task-based Learning Approach: A Case Study of Student Strategies to Overcome Difficulties Shu-Chiao Tsai Associate professor, Department

More information

The HKICPA Accounting and Business Management Case Competition 2015-16. Secondary School Group (Level 1)

The HKICPA Accounting and Business Management Case Competition 2015-16. Secondary School Group (Level 1) The HKICPA Accounting and Business Management Case Competition 2015-16 Secondary School Group (Level 1) The HKICPA Accounting and Business Management Case Competition 2015-16 Secondary School Group (Level

More information

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program. Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to

More information

Keywords are identifiers having predefined meanings in C programming language. The list of keywords used in standard C are : unsigned void

Keywords are identifiers having predefined meanings in C programming language. The list of keywords used in standard C are : unsigned void 1. Explain C tokens Tokens are basic building blocks of a C program. A token is the smallest element of a C program that is meaningful to the compiler. The C compiler recognizes the following kinds of

More information

余 雋 禧 仇 慧 琳 宣 教 士 夫 婦

余 雋 禧 仇 慧 琳 宣 教 士 夫 婦 余 雋 禧 仇 慧 琳 宣 教 士 夫 婦 Email & Skype: missionarykenny@gmail.com 二 零 一 五 年 十 二 月 家 書 親 愛 的 主 內 弟 兄 姐 妹 和 朋 友, 分 享 家 事 自 從 兒 子 於 七 月 出 生 後, 我 們 的 生 活 簡 直 是 翻 了 個 天, 每 天 忙 著 餵 奶 換 尿 布, 哄 睡 覺, 但 相 信 這 也 是 每

More information

Wi-Drive User Guide. (for use with Amazon s Kindle Fire) Document No. 480WID4KF-001.A01 Kingston Wi-Drive Page 1 of 15

Wi-Drive User Guide. (for use with Amazon s Kindle Fire) Document No. 480WID4KF-001.A01 Kingston Wi-Drive Page 1 of 15 Wi-Drive User Guide (for use with Amazon s Kindle Fire) Document No. 480WID4KF-001.A01 Kingston Wi-Drive Page 1 of 15 Table of Contents Introduction... 3 Requirements... 3 Supported File Types... 3 Install

More information

How To Be The Legend In Hong Kong

How To Be The Legend In Hong Kong 5th 與 東 亞 運 共 創 傳 奇 一 刻 Hong Kong shows East Asia it can Be the Legend History was made from 5 to 13 December 2009 when Hong Kong successfully hosted its first-ever international multi-sports event, the

More information

UEE1302 (1102) F10 Introduction to Computers and Programming

UEE1302 (1102) F10 Introduction to Computers and Programming Computational Intelligence on Automation Lab @ NCTU UEE1302 (1102) F10 Introduction to Computers and Programming Programming Lecture 03 Flow of Control (Part II): Repetition while,for & do..while Learning

More information

Senem Kumova Metin & Ilker Korkmaz 1

Senem Kumova Metin & Ilker Korkmaz 1 Senem Kumova Metin & Ilker Korkmaz 1 A loop is a block of code that can be performed repeatedly. A loop is controlled by a condition that is checked each time through the loop. C supports two categories

More information

Perl in a nutshell. First CGI Script and Perl. Creating a Link to a Script. print Function. Parsing Data 4/27/2009. First CGI Script and Perl

Perl in a nutshell. First CGI Script and Perl. Creating a Link to a Script. print Function. Parsing Data 4/27/2009. First CGI Script and Perl First CGI Script and Perl Perl in a nutshell Prof. Rasley shebang line tells the operating system where the Perl interpreter is located necessary on UNIX comment line ignored by the Perl interpreter End

More information

Case Study of a New Generation Call Center

Case Study of a New Generation Call Center Case Study of a New Generation Call Center Chiung-I Chang* and tzy-yau lee** *Department of Information Management National Taichung Institute of Technology E-mail: ccy@ntit.edu.tw **Department of Leisure

More information

REGULATIONS FOR THE DEGREE OF BACHELOR OF ARTS IN ARCHITECTURAL STUDIES (BA[ArchStud])

REGULATIONS FOR THE DEGREE OF BACHELOR OF ARTS IN ARCHITECTURAL STUDIES (BA[ArchStud]) REGULATIONS FOR THE DEGREE OF BACHELOR OF ARTS IN ARCHITECTURAL STUDIES (BA[ArchStud]) These regulations and syllabuses apply to students admitted in the 2011-12 academic year and thereafter. (See also

More information

In this Chapter you ll learn:

In this Chapter you ll learn: Now go, write it before them in a table, and note it in a book. Isaiah 30:8 To go beyond is as wrong as to fall short. Confucius Begin at the beginning, and go on till you come to the end: then stop. Lewis

More information

广 东 培 正 学 院 2016 年 本 科 插 班 生 专 业 课 考 试 大 纲 基 础 英 语 课 程 考 试 大 纲

广 东 培 正 学 院 2016 年 本 科 插 班 生 专 业 课 考 试 大 纲 基 础 英 语 课 程 考 试 大 纲 广 东 培 正 学 院 2016 年 本 科 插 班 生 专 业 课 考 试 大 纲 基 础 英 语 课 程 考 试 大 纲 Ⅰ. 考 试 性 质 普 通 高 等 学 校 本 科 插 班 生 招 生 考 试 是 由 专 科 毕 业 生 参 加 的 选 拔 性 考 试 高 等 学 校 根 据 考 生 的 成 绩, 按 已 确 定 的 招 生 计 划, 德 智 体 全 面 衡 量, 择 优 录 取 该

More information

Installation Guide 2/4-Port DVI KVMP Switch with Cables

Installation Guide 2/4-Port DVI KVMP Switch with Cables Installation Guide 2/4-Port DVI KVMP Switch with Cables GCS1102/GCS1104 PART NO. M1108/M1109 Table of Contents Package Contents 4 System Requirements 5 GCS1102 Overview 6 GCS1104 Overview 8 Installation

More information

JavaScript: Introduction to Scripting. 2008 Pearson Education, Inc. All rights reserved.

JavaScript: Introduction to Scripting. 2008 Pearson Education, Inc. All rights reserved. 1 6 JavaScript: Introduction to Scripting 2 Comment is free, but facts are sacred. C. P. Scott The creditor hath a better memory than the debtor. James Howell When faced with a decision, I always ask,

More information

CS 241 Data Organization Coding Standards

CS 241 Data Organization Coding Standards CS 241 Data Organization Coding Standards Brooke Chenoweth University of New Mexico Spring 2016 CS-241 Coding Standards All projects and labs must follow the great and hallowed CS-241 coding standards.

More information

China M&A goes global

China M&A goes global China M&A goes global Hairong Li of Zhong Lun Law Firm explains the new regulations affecting inbound and outbound M&A, the industries most targeted by Chinese and foreign investors and the unique strategies

More information

Installation Guide Universal Wireless-n Adapter GWU627 PART NO. M1161

Installation Guide Universal Wireless-n Adapter GWU627 PART NO. M1161 Installation Guide Universal Wireless-n Adapter GWU627 PART NO. M1161 Table of Contents Package Contents 4 System Requirements 5 Product Overview 6 Installation 8 Installation without WPS - Windows XP

More information

Visual Logic Instructions and Assignments

Visual Logic Instructions and Assignments Visual Logic Instructions and Assignments Visual Logic can be installed from the CD that accompanies our textbook. It is a nifty tool for creating program flowcharts, but that is only half of the story.

More information

Moving from CS 61A Scheme to CS 61B Java

Moving from CS 61A Scheme to CS 61B Java Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you

More information

Flowchart Techniques

Flowchart Techniques C H A P T E R 1 Flowchart Techniques 1.1 Programming Aids Programmers use different kinds of tools or aids which help them in developing programs faster and better. Such aids are studied in the following

More information

Protel DXP 2004 Schematic 開 始 所 有 程 式 Altium DXP 2004

Protel DXP 2004 Schematic 開 始 所 有 程 式 Altium DXP 2004 Protel DXP 2004 Schematic 開 始 所 有 程 式 Altium DXP 2004 1 File New PCB Project 2 Save Project As Right click Project 儲 存 路 徑 不 可 以 有 中 文 3 D:\Exercise Project 儲 存 路 徑 不 可 以 有 中 文 4 Add New to Project Schematic

More information

While Loop. 6. Iteration

While Loop. 6. Iteration While Loop 1 Loop - a control structure that causes a set of statements to be executed repeatedly, (reiterated). While statement - most versatile type of loop in C++ false while boolean expression true

More information

Kingston MobileLite Wireless. (ßeta Release) Document No. 480WD+MLW.ß01 Kingston MobileLite Wireless (ßeta) Page 1 of 12

Kingston MobileLite Wireless. (ßeta Release) Document No. 480WD+MLW.ß01 Kingston MobileLite Wireless (ßeta) Page 1 of 12 Kingston MobileLite Wireless (ßeta Release) Document No. 480WD+MLW.ß01 Kingston MobileLite Wireless (ßeta) Page 1 of 12 Introduction MobileLite Wireless (simply referred to as MLW from this point forward)

More information

Should lidocaine spray be used to ease nasogastric tube insertion? A double-blind, randomised controlled trial

Should lidocaine spray be used to ease nasogastric tube insertion? A double-blind, randomised controlled trial O R I G I N A L A R T I C L E Should lidocaine spray be used to ease nasogastric tube insertion? A double-blind, randomised controlled trial CP Chan FL Lau 陳 志 鵬 劉 飛 龍 Objective To investigate the efficacy

More information

Writing Control Structures

Writing Control Structures Writing Control Structures Copyright 2006, Oracle. All rights reserved. Oracle Database 10g: PL/SQL Fundamentals 5-1 Objectives After completing this lesson, you should be able to do the following: Identify

More information

Microsoft SQL Server PDW 新世代 MPP 資料倉儲解決方案

Microsoft SQL Server PDW 新世代 MPP 資料倉儲解決方案 DBI304 Microsoft SQL Server PDW 新世代 MPP 資料倉儲解決方案 徐園程 Sr. Technical Account Manager Thomas.Hsu@Microsoft.com 微軟資料倉儲的願景 未來趨勢 Appliance PDW AU3 新功能 Hub & Spoke 架構運用 PDW & Big Data 大綱 客戶案例分享 與其他 MPP 比較 100%

More information

LOOPS CHAPTER CHAPTER GOALS

LOOPS CHAPTER CHAPTER GOALS jfe_ch04_7.fm Page 139 Friday, May 8, 2009 2:45 PM LOOPS CHAPTER 4 CHAPTER GOALS To learn about while, for, and do loops To become familiar with common loop algorithms To understand nested loops To implement

More information

VB.NET Programming Fundamentals

VB.NET Programming Fundamentals Chapter 3 Objectives Programming Fundamentals In this chapter, you will: Learn about the programming language Write a module definition Use variables and data types Compute with Write decision-making statements

More information

國 立 中 山 大 學 企 業 管 理 學 系 碩 士 論 文

國 立 中 山 大 學 企 業 管 理 學 系 碩 士 論 文 國 立 中 山 大 學 企 業 管 理 學 系 碩 士 論 文 Department of Business Management National Sun Yat-sen University Master Thesis 尋 求 網 路 廣 告 績 效 最 佳 化 機 制 Optimizing Performance of Internet Advertising Campaigns 研 究 生

More information

Lecture 2 Notes: Flow of Control

Lecture 2 Notes: Flow of Control 6.096 Introduction to C++ January, 2011 Massachusetts Institute of Technology John Marrero Lecture 2 Notes: Flow of Control 1 Motivation Normally, a program executes statements from first to last. The

More information

Closure of the Landside Impermeable Wall (Ice Wall) Commencement

Closure of the Landside Impermeable Wall (Ice Wall) Commencement Closure of the Landside Impermeable Wall (Ice Wall) Commencement March 31, 2016 Tokyo Electric Power Company KAJIMA CORPORATION 1 Brief overview of the Landside Impermeable Wall (Ice Wall)

More information

The C++ Language. Loops. ! Recall that a loop is another of the four basic programming language structures

The C++ Language. Loops. ! Recall that a loop is another of the four basic programming language structures The C++ Language Loops Loops! Recall that a loop is another of the four basic programming language structures Repeat statements until some condition is false. Condition False True Statement1 2 1 Loops

More information

Romeo and Juliet 罗 密 欧 与 茱 丽 叶

Romeo and Juliet 罗 密 欧 与 茱 丽 叶 Romeo and Juliet 1 A Famous Love Story 驰 名 的 爱 情 故 事 Romeo and Juliet 罗 密 欧 与 茱 丽 叶 Although he died almost 400 years ago, William Shakespeare is still one of the most popular English writers in the world.

More information

Tender Document for Procurement of the Security Screening Equipment at MIA (RFQ-151)

Tender Document for Procurement of the Security Screening Equipment at MIA (RFQ-151) Tender Document for Procurement of the Security Screening Equipment at MIA (RFQ-151) Tender Time table Description Date Remark Open Tender Notice 23 April 2013 Deadline of Request for Site Visit: Bidder

More information

The While Loop. Objectives. Textbook. WHILE Loops

The While Loop. Objectives. Textbook. WHILE Loops Objectives The While Loop 1E3 Topic 6 To recognise when a WHILE loop is needed. To be able to predict what a given WHILE loop will do. To be able to write a correct WHILE loop. To be able to use a WHILE

More information

Conditionals (with solutions)

Conditionals (with solutions) Conditionals (with solutions) For exercises 1 to 27, indicate the output that will be produced. Assume the following declarations: final int MAX = 25, LIMIT = 100; int num1 = 12, num2 = 25, num3 = 87;

More information

Chapter 9. Subprograms

Chapter 9. Subprograms Chapter 9 Subprograms ISBN 0-321-33025-0 Chapter 9 Topics Introduction Fundamentals of Subprograms Design Issues for Subprograms Local Referencing Environments Parameter-Passing Methods Parameters That

More information

Customers' Trust and Purchase Intention towards. Taobao's Alipay (China online marketplace)

Customers' Trust and Purchase Intention towards. Taobao's Alipay (China online marketplace) Customers' Trust and Purchase Intention towards Taobao's Alipay (China online marketplace) By Wong Tak Yan, Isabella 08032084 & Yeung Yuen Ha, Rabeea 08037728 An Honours Degree Project Submitted to the

More information

歐 洲 難 民 潮 對 經 濟 的 影 響 The Economic Implications of Europe s Refugee Influx

歐 洲 難 民 潮 對 經 濟 的 影 響 The Economic Implications of Europe s Refugee Influx 歐 洲 難 民 潮 對 經 濟 的 影 響 The Economic Implications of Europe s Refugee Influx 沈 旭 暉 副 教 授 香 港 中 文 大 學 國 際 事 務 研 究 中 心 聯 席 主 任 Dr Simon Shen Co-Director International Affairs Research Center Hong Kong Institute

More information

Exploring the Relationship Between Critical Thinking and Active. Participation in Online Discussions and Essays

Exploring the Relationship Between Critical Thinking and Active. Participation in Online Discussions and Essays Exploring the Relationship Between Critical Thinking and Active Participation in Online Discussions and Essays Graham J. PASSMORE, Ellen Carter, & Tom O NEILL Lakehead University, Brock University, Brock

More information

Data Structures Chapter 3 Stacks and Queues

Data Structures Chapter 3 Stacks and Queues Data Structures Chapter 3 Stacks and Queues Instructor: Ching Chi Lin 林 清 池 助 理 教 授 chingchi.lin@gmail.com Department of Computer Science and Engineering National Taiwan Ocean University Outline Stacks

More information

weekly Our mission Our history Our footprint Our award-winning content 2015 Media Kit asian northwest

weekly Our mission Our history Our footprint Our award-winning content 2015 Media Kit asian northwest 2015 Media Kit asian Our mission Asian Pacific American communities have been called, The market of the 21st century. The Northwest Asian Weekly (NWAW) and our sister paper, The Seattle Chinese Post (SCP),

More information

ASCII Encoding. The char Type. Manipulating Characters. Manipulating Characters

ASCII Encoding. The char Type. Manipulating Characters. Manipulating Characters The char Type ASCII Encoding The C char type stores small integers. It is usually 8 bits. char variables guaranteed to be able to hold integers 0.. +127. char variables mostly used to store characters

More information

Informatica e Sistemi in Tempo Reale

Informatica e Sistemi in Tempo Reale Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 25, 2010 G. Lipari (Scuola Superiore Sant Anna)

More information

6. Control Structures

6. Control Structures - 35 - Control Structures: 6. Control Structures A program is usually not limited to a linear sequence of instructions. During its process it may bifurcate, repeat code or take decisions. For that purpose,

More information

Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner.

Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner. Handout 1 CS603 Object-Oriented Programming Fall 15 Page 1 of 11 Handout 1 Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner. Java

More information

Validity and reliability of the Chinese version of the Insulin Treatment Appraisal Scale among primary care patients in Hong Kong

Validity and reliability of the Chinese version of the Insulin Treatment Appraisal Scale among primary care patients in Hong Kong Original Article Validity and reliability of the Chinese version of the Insulin Treatment Appraisal Scale among primary care patients in Hong Kong KP Lee * This article was published on 3 Jun 2016 at www.hkmj.org.

More information

The Government of The Hong Kong Special Administrative Region Procedures for Importation and Registration of Motor Vehicles & Motor Cycles

The Government of The Hong Kong Special Administrative Region Procedures for Importation and Registration of Motor Vehicles & Motor Cycles The Government of The Hong Kong Special Administrative Region Procedures for Importation and Registration of Motor Vehicles & Motor Cycles (Last revised on August 2014) The information below explains the

More information

Spectrum: Studies in Language, Literature, Translation, and Interpretation, Vol. 2, 85-92

Spectrum: Studies in Language, Literature, Translation, and Interpretation, Vol. 2, 85-92 Spectrum: Studies in Language, Literature, Translation, and Interpretation, Vol. 2, 85-92 Tales of Good-hearted Women: A Comparison of Gustave Flaubert's Un Coeur simple and Gertrude Stein's The Good Anna

More information

轎 車 機 場 接 送 及 往 返 澳 門 與 香 港 機 場 接 送 服 務 禮 遇 ( 推 廣 ) 之 條 款 及 細 則 :

轎 車 機 場 接 送 及 往 返 澳 門 與 香 港 機 場 接 送 服 務 禮 遇 ( 推 廣 ) 之 條 款 及 細 則 : 一 般 條 款 及 細 則 Terms & Conditions : 轎 車 機 場 接 送 及 往 返 澳 門 與 香 港 機 場 接 送 服 務 禮 遇 ( 推 廣 ) 之 條 款 及 細 則 : (I) 一 般 條 款 : 1. 轎 車 機 場 接 送 及 往 返 澳 門 與 香 港 機 場 接 送 服 務 禮 遇 推 廣 由 即 日 起 至 2016 年 12 月 31 日 止 ( 推 廣

More information

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement? 1. Distinguish & and && operators. PART-A Questions 2. How does an enumerated statement differ from a typedef statement? 3. What are the various members of a class? 4. Who can access the protected members

More information

Unit 6. Loop statements

Unit 6. Loop statements Unit 6 Loop statements Summary Repetition of statements The while statement Input loop Loop schemes The for statement The do statement Nested loops Flow control statements 6.1 Statements in Java Till now

More information

新 媒 體 傳 播 策 略 應 用 學 習 課 程 2015-2017

新 媒 體 傳 播 策 略 應 用 學 習 課 程 2015-2017 新 媒 體 傳 播 策 略 應 用 學 習 課 程 2015-2017 1 新 媒 體 傳 播 策 略 本 課 程 旨 在 讓 學 生 掌 握 新 媒 體 傳 播 策 略 的 知 識, 如 互 動 媒 體 社 交 媒 體 視 頻 剪 輯 和 移 動 應 用 程 式 透 過 設 計 規 劃 和 執 行 過 程 中, 學 生 學 習 使 用 精 練 信 息 來 溝 通 課 程 內 容 亦 函 蓋 整 合

More information

PROGRAMMING IN C PROGRAMMING IN C CONTENT AT A GLANCE

PROGRAMMING IN C PROGRAMMING IN C CONTENT AT A GLANCE PROGRAMMING IN C CONTENT AT A GLANCE 1 MODULE 1 Unit 1 : Basics of Programming Unit 2 : Fundamentals Unit 3 : C Operators MODULE 2 unit 1 : Input Output Statements unit 2 : Control Structures unit 3 :

More information

Variables, Constants, and Data Types

Variables, Constants, and Data Types Variables, Constants, and Data Types Primitive Data Types Variables, Initialization, and Assignment Constants Characters Strings Reading for this class: L&L, 2.1-2.3, App C 1 Primitive Data There are eight

More information

A SERVER-LESS ARCHITECTURE FOR BUILDING SCALABLE, RELIABLE, AND COST-EFFECTIVE VIDEO-ON-DEMAND SYSTEMS

A SERVER-LESS ARCHITECTURE FOR BUILDING SCALABLE, RELIABLE, AND COST-EFFECTIVE VIDEO-ON-DEMAND SYSTEMS A SERVER-LESS ARCHITECTURE FOR BUILDING SCALABLE, RELIABLE, AND COST-EFFECTIVE VIDEO-ON-DEMAND SYSTEMS LEUNG WAI TAK A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of Master

More information

Introduction to Python

Introduction to Python WEEK ONE Introduction to Python Python is such a simple language to learn that we can throw away the manual and start with an example. Traditionally, the first program to write in any programming language

More information

Iteration CHAPTER 6. Topic Summary

Iteration CHAPTER 6. Topic Summary CHAPTER 6 Iteration TOPIC OUTLINE 6.1 while Loops 6.2 for Loops 6.3 Nested Loops 6.4 Off-by-1 Errors 6.5 Random Numbers and Simulations 6.6 Loop Invariants (AB only) Topic Summary 6.1 while Loops Many

More information

Notes on Algorithms, Pseudocode, and Flowcharts

Notes on Algorithms, Pseudocode, and Flowcharts Notes on Algorithms, Pseudocode, and Flowcharts Introduction Do you like hot sauce? Here is an algorithm for how to make a good one: Volcanic Hot Sauce (from: http://recipeland.com/recipe/v/volcanic-hot-sauce-1125)

More information

(Chapter 218) APPLICATION FOR A LICENCE BY A BODY CORPORATE

(Chapter 218) APPLICATION FOR A LICENCE BY A BODY CORPORATE Monday Form Collection Time 8:45 a.m. 12:30 p.m. FORM 3 TRAVEL AGENTS ORDINANCE to Friday 2:00 p.m. 5:00 p.m. (Chapter 218) APPLICATION FOR A LICENCE BY A BODY CORPORATE [reg. 9(1)(b).] Application is

More information

2 SYSTEM DESCRIPTION TECHNIQUES

2 SYSTEM DESCRIPTION TECHNIQUES 2 SYSTEM DESCRIPTION TECHNIQUES 2.1 INTRODUCTION Graphical representation of any process is always better and more meaningful than its representation in words. Moreover, it is very difficult to arrange

More information

Wi-Fi SD. Sky Share S10 User Manual

Wi-Fi SD. Sky Share S10 User Manual Wi-Fi SD Sky Share S10 User Manual Table of Contents 1. Introduction... 3 2. Spec and System Requirements... 4 3. Start Sky Share S10... 5 4. iphone App... 7 5. ipad App... 13 6. Android App... 15 7. Web

More information

CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013

CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013 Oct 4, 2013, p 1 Name: CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013 1. (max 18) 4. (max 16) 2. (max 12) 5. (max 12) 3. (max 24) 6. (max 18) Total: (max 100)

More information

2010/9/19. Binary number system. Binary numbers. Outline. Binary to decimal

2010/9/19. Binary number system. Binary numbers. Outline. Binary to decimal 2/9/9 Binary number system Computer (electronic) systems prefer binary numbers Binary number: represent a number in base-2 Binary numbers 2 3 + 7 + 5 Some terminology Bit: a binary digit ( or ) Hexadecimal

More information

1 Description of The Simpletron

1 Description of The Simpletron Simulating The Simpletron Computer 50 points 1 Description of The Simpletron In this assignment you will write a program to simulate a fictional computer that we will call the Simpletron. As its name implies

More information

So far we have considered only numeric processing, i.e. processing of numeric data represented

So far we have considered only numeric processing, i.e. processing of numeric data represented Chapter 4 Processing Character Data So far we have considered only numeric processing, i.e. processing of numeric data represented as integer and oating point types. Humans also use computers to manipulate

More information

Procedures to file a request to the JPO for Patent Prosecution Highway Pilot Program between the JPO and the HPO

Procedures to file a request to the JPO for Patent Prosecution Highway Pilot Program between the JPO and the HPO Procedures to file a request to the JPO for Patent Prosecution Highway Pilot Program between the JPO and the HPO 1. to the JPO When an applicant files a request for an accelerated examination under the

More information

Q&As: Microsoft Excel 2013: Chapter 2

Q&As: Microsoft Excel 2013: Chapter 2 Q&As: Microsoft Excel 2013: Chapter 2 In Step 5, why did the date that was entered change from 4/5/10 to 4/5/2010? When Excel recognizes that you entered a date in mm/dd/yy format, it automatically formats

More information

Pseudo code Tutorial and Exercises Teacher s Version

Pseudo code Tutorial and Exercises Teacher s Version Pseudo code Tutorial and Exercises Teacher s Version Pseudo-code is an informal way to express the design of a computer program or an algorithm in 1.45. The aim is to get the idea quickly and also easy

More information

Ex. Either we must get in line early to buy the tickets, or only scalpers INDEPENDENT CLAUSE 1 INDEPENDENT tickets will be available.

Ex. Either we must get in line early to buy the tickets, or only scalpers INDEPENDENT CLAUSE 1 INDEPENDENT tickets will be available. THIRTEENTH WEEK PAGE 1 COMPOUND SENTENCES II The COMPOUND SENTENCE A. A COMPOUND SENTENCE contains two or more INDEPENDENT clauses. B. INDEPENDENT CLAUSES CAN stand alone, so it is very easy to separate

More information

Problem Solving Basics and Computer Programming

Problem Solving Basics and Computer Programming Problem Solving Basics and Computer Programming A programming language independent companion to Roberge/Bauer/Smith, "Engaged Learning for Programming in C++: A Laboratory Course", Jones and Bartlett Publishers,

More information

How To Write Portable Programs In C

How To Write Portable Programs In C Writing Portable Programs COS 217 1 Goals of Today s Class Writing portable programs in C Sources of heterogeneity Data types, evaluation order, byte order, char set, Reading period and final exam Important

More information

Decision Logic: if, if else, switch, Boolean conditions and variables

Decision Logic: if, if else, switch, Boolean conditions and variables CS 1044 roject 3 Fall 2009 Decision Logic: if, if else, switch, Boolean conditions and variables This programming assignment uses many of the ideas presented in sections 3 through 5 of the Dale/Weems text

More information

Chapter 7: Software Development Stages Test your knowledge - answers

Chapter 7: Software Development Stages Test your knowledge - answers Chapter 7: Software Development Stages Test your knowledge - answers 1. What is meant by constraints and limitations on program design? Constraints and limitations are based on such items as operational,

More information