CS1150 Principles of Computer Science Loops
|
|
- Marvin Cross
- 6 years ago
- Views:
Transcription
1 CS1150 Principles f Cmputer Science Lps Yanyan Zhuang Department f Cmputer Science CS1150 UC. Clrad Springs
2 Annuncement HW1 graded HW2 due tnight HW3 will be psted sn Due next Mnday July 3 Midterm July 5 in class N assignment next week, but practice questins will be psted Extra ffice hurs: 10am -12pm July 5 (n ffice hur July 6) CS1150 UC. Clrad Springs
3 Feedback n HW1 if there are multiple lines f cmments /*... */ Recmmend: indenting them as it visually makes them easier t pick ut, e.g. /* this is a multi-line cmment fr an example. */ CS1150 UC. Clrad Springs
4 Feedback n HW1 'whitespace' vs. tabs Editrs tday in Windws/Mac will let yu use tabs t indent This causes readability / indenting prblems when yur cde is viewed in a different envirnment (a different OS, editr, etc.) Recmmendatin (but nt enfrced): change Eclipse t use spaces instead f tabs CS1150 UC. Clrad Springs
5 Review Blean variables Assume x=3, true r false?!(x<2) y>3 If statement Be careful: multiple/nested if else By default: else is mathced with if? Switch statement Be careful: where t use break CS4500/5500 UC. Clrad Springs
6 Overview While lp D while lp Fr lp CS1150 UC. Clrad Springs
7 Opening Prblem: Why Lps? Prblem: 100 times System.ut.println("Welcme t Java!"); System.ut.println("Welcme t Java!"); System.ut.println("Welcme t Java!"); System.ut.println("Welcme t Java!"); System.ut.println("Welcme t Java!"); System.ut.println("Welcme t Java!"); System.ut.println("Welcme t Java!"); System.ut.println("Welcme t Java!"); System.ut.println("Welcme t Java!"); 7
8 Intrducing while Lps int cunt = 0; while (cunt < 100) { System.ut.println("Welcme t Java"); cunt++; 8
9 Intrducing while Lps int cunt = 0; while (cunt < 100) { System.ut.println("Welcme t Java"); cunt++; Hw It Wrks The lp cntinuatin cnditin - blean expressin - is evaluated If the cnditin is true, the statements in the lp bdy are executed When executin f lp bdy statements is cmplete, cntrl returns t the lp cnditin The lp cntinuatin cnditin is evaluated again When the lp cnditin is false, cntrl ges t the 1st statement fllwing the lp Nte: if the lp cntinuatin cnditin evaluates t false the 1st time, the entire while lp is skipped 9 while (lp-cntinuatin-cnditin) { // lp-bdy; Statement(s);
10 while Lp Flw Chart while (lp-cntinuatin-cnditin) { // lp-bdy; Statement(s); int cunt = 0; while (cunt < 100) { System.ut.println("Welcme t Java!"); cunt++; 10
11 Rules fr While Lps The lp cnditin must be a blean expressin Blean expressin must be in parentheses Blean expressins are frmed using relatinal r lgical peratrs Lp cnditin Usually a statement befre the while lp "initializes" the lp cnditin t true Sme statement within the lp bdy eventually change the cnditin t false If the cnditin is never changed t false, the prgram is frever in the lp This is called an "infinite lp" Curly braces are nt necessary if nly ne statement in lp But best practice is t always include curly braces CS4500/5500 UC. Clrad Springs
12 Trace while Lp int cunt = 0; while (cunt < 2) { System.ut.println("Welcme t Java!"); cunt++; Initialize cunt (which we ften call cntrl variable) 12
13 Trace while Lp, cnt. int cunt = 0; while (cunt < 2) { System.ut.println("Welcme t Java!"); cunt++; (cunt < 2) is true 13
14 Trace while Lp, cnt. int cunt = 0; while (cunt < 2) { System.ut.println("Welcme t Java!"); cunt++; Print Welcme t Java 14
15 Trace while Lp, cnt. int cunt = 0; while (cunt < 2) { System.ut.println("Welcme t Java!"); cunt++; Increase cunt by 1 cunt is 1 nw 15
16 Trace while Lp, cnt. int cunt = 0; while (cunt < 2) { System.ut.println("Welcme t Java!"); cunt++; (cunt < 2) is still true since cunt is 1 16
17 Trace while Lp, cnt. int cunt = 0; while (cunt < 2) { System.ut.println("Welcme t Java!"); cunt++; Print Welcme t Java 17
18 Trace while Lp, cnt. int cunt = 0; while (cunt < 2) { System.ut.println("Welcme t Java!"); cunt++; Increase cunt by 1 cunt is 2 nw 18
19 Trace while Lp, cnt. int cunt = 0; while (cunt < 2) { System.ut.println("Welcme t Java!"); cunt++; (cunt < 2) is false since cunt is 2 nw 19
20 Trace while Lp, cnt. int cunt = 0; while (cunt < 2) { System.ut.println("Welcme t Java!"); cunt++; The lp exits. Execute the next statement after the lp. Let s lk at the first cde example. Questin: hw t get the rdinal right? 20
21 Infinite lp example In this example, nthing in the lp bdy changes the value f the cntrl variable cunt = 1; // Initializes the lp cntrl variable while (cunt <= 5) { System.ut.println("The value f cunt is " + cunt); This is an infinite lp because (cunt <= 5) is always true Nthing changes the value f cunt in the lp bdy If yu accidentally create an infinite lp, use terminate buttn (red square) in Eclipse t make it stp CS4500/5500 UC. Clrad Springs
22 Placing a semicln at the end f the while-clause creates an infinite lp - be careful! int iteratin = 1; while (iteratin <= 10); { System.ut.println("Iteratin = " + iteratin); iteratin++; CS4500/5500 UC. Clrad Springs
23 Off-by-ne Errr Cmmn issue with lps: Lp bdy executes ne mre/less than expected Example: System.ut.println("I'm ging t cunt t three, ready set..."); cunt = 1; while (cunt < 3) { System.ut.println(cunt); cunt++; CS4500/5500 UC. Clrad Springs
24 Off-by-ne Errr Cmmn issue with lps: Lp bdy executes ne mre/less than expected Example: System.ut.println("I'm ging t cunt t three, ready set..."); cunt = 1; while (cunt < 3) { Output: System.ut.println(cunt); cunt++; I'm ging t cunt t three, ready set CS4500/5500 UC. Clrad Springs
25 Prblem: Repeat Additin Until Crrect See sample cde. Practice! Limit the number f trials t 5, and exit regardless if the answer if crrect r nt. 25
26 Ending a Lp with a Sentinel Value Often the number f times a lp is executed is nt predetermined. Yu may use an input value t signify the end f the lp. Such a value is knwn as a sentinel value. Write a prgram that reads and calculates the sum f an unspecified number f integers (e.g., the sum f 2, 3, 5, 7, 11 ). The input 0 signifies the end f the input. See sample cde. 26
27 Cautin Dn t use flating-pint values fr equality checking in a lp cntrl. Since flating-pint values are apprximatins fr sme values, using them culd result in imprecise cunter values and inaccurate results. Cnsider the fllwing cde: duble item = 1; duble sum = 0; while (item!= 0) { // N guarantee item will be 0 sum += item; if (item >=0) System.ut.println("when item is " + item + ", sum is " + sum); item -= 0.1; System.ut.println(sum); 27
28 Cautin duble item = 1; duble sum = 0; while (item!= 0) { // N guarantee item will be 0 sum += item; if (item >=0) System.ut.println("when item is " + item + ", sum is " + sum); item -= 0.1; System.ut.println(sum); Item = 0.9 Item = 0.8 Item = // Values are starting t get ff Item = Item = Item = Item = Item = Item = // Off enugh t miss 0 Item = E-16 28
29 d-while Lp d { // Lp bdy; Statement(s); while (lp-cntinuatin-cnditin) The lp bdy is executed The lp cnditin - blean expressin - is evaluated If the lp cnditin is true, then lp bdy is executed again If the lp cnditin is false, cntrl is transferred t the 1st statement fllwing the lp 29
30 D While Lp Rules (same as while lp) The lp cnditin must be a blean expressin Blean expressin must be in parentheses Blean expressin is frmed using relatinal and lgical peratrs Lp cnditin Generally, sme statement befre the while lp "initializes" the lp cnditin t true Sme statement within the lp bdy must eventually change the cnditin t false If the cnditin is never changed t false, the prgram will be frever stuck in the lp This is called an "infinite lp" Curly braces are nt necessary if nly ne statement in lp but best practice is t always include curly braces CS4500/5500 UC. Clrad Springs
31 Nte Recall hw placing a semicln at the end f the while-clause creates an infinite lp int iteratin = 1; while (iteratin <= 10); { // Unnecessary semicln System.ut.println("Iteratin = " + iteratin); iteratin++; CS4500/5500 UC. Clrad Springs
32 Nte In the case f d-while yu must include the semicln since it ends the lp! int iteratin = 1; d { iteratin++; System.ut.println("Iteratin = " + iteratin); while (iteratin <= 5); // Necessary semicln CS4500/5500 UC. Clrad Springs
33 Lp Design Strategies Fur steps when writing a lp. Step 1: Identify what statements need t be repeated Step 2: Wrap these statements in a lp using while r d while: while (true) { Statements; Step 3: Determine what cnditin the cde shuld check (replace true) Step 4: Add cde in the bdy that eventually causes the cnditin t becme false while (lp-cntinuatin-cnditin) { Statements; Additinal statements fr cntrlling the lp; CS4500/5500 UC. Clrad Springs
34 Annuncement HW3 psted Will pst practice questins fr midterm sn Als imprtant things fr the exam N hmewrk next week CS4500/5500 UC. Clrad Springs
35 Review If statements (nested) The else clause matches the mst recent if clause CS4500/5500 UC. Clrad Springs
36 Review If statements (nested) T frce the else clause t match the first if clause, must add a pair f braces int i = 1, j = 2, k = 3; if (i > j) { else if (i > k) System.ut.println("A"); System.ut.println("B"); CS4500/5500 UC. Clrad Springs
37 Review Switch statement True r false? Break is required in a switch statement While and d while lps Which lp is executed at least nce? Is this an infinite lp? Why (nt)? int cunt = 1; while (cunt <= 5) { System.ut.println("The value f cunt is " + cunt); CS4500/5500 UC. Clrad Springs
38 Review Is this an infinite lp? Why (nt)? int cunt = 1; while (cunt <= 5); { System.ut.println("The value f cunt is " + cunt); cunt++; CS4500/5500 UC. Clrad Springs
39 Review Is this an infinite lp? Why (nt)? int cunt = 1; while (cunt <= 5); { System.ut.println("The value f cunt is " + cunt); cunt++; int cunt = 1; d { cunt++; System.ut.println( Cunt = " + cunt); while (cunt<= 5); CS4500/5500 UC. Clrad Springs
40 Overview While lp D while lp (Ging ver hw3 hw t design a lp) Fr lp CS1150 UC. Clrad Springs
41 Fr lps Fr lps are used t execute a lp a preset number f times fr ( 1 initial-actin; 2 lp-cnditin; 4 actin-after-each-iteratin) { 3 Statement(s); 1. The cntrl variable is initialized t a start value 2. The cntrl variable is cmpared t the lp cnditin 3. If the cnditin is true, then lp bdy is executed 4. The cntrl variable is updated after lp bdy cmpletes 5. Steps 2-4 are repeated as lng as the lp cnditin is true CS4500/5500 UC. Clrad Springs
42 fr Lps fr (initial-actin; lp-cntinuatincnditin; actin-after-each-iteratin){ // lp bdy; Statement(s); int i; fr (i = 0; i < 100; i++) { System.ut.println( "Welcme t Java!"); 42
43 Rules f fr lps The cntrl structure f the fr-lp needs t be in parentheses fr (i=0; i<= 2; i++) { statements; The lp cnditin (i <= 2) must be a blean expressin The cntrl variable (i): nt recmmended t be changed within the fr-lp bdy Curly braces are nt necessary if nly ne statement in lp Best practice is t always include curly braces CS4500/5500 UC. Clrad Springs
44 Trace fr Lp int i; fr (i = 0; i < 2; i++) { System.ut.println("Welcme t Java!"); Declare i 44
45 Trace fr Lp, cnt. int i; fr (i = 0; i < 2; i++) { System.ut.println("Welcme t Java!"); Execute initializer i is nw 0 45
46 Trace fr Lp, cnt. int i; fr (i = 0; i < 2; i++) { System.ut.println( "Welcme t Java!"); (i < 2) is true since i is 0 46
47 Trace fr Lp, cnt. int i; fr (i = 0; i < 2; i++) { System.ut.println( "Welcme t Java!"); Print Welcme t Java 47
48 Trace fr Lp, cnt. Execute adjustment statement int i; i nw is 1 fr (i = 0; i < 2; i++) { System.ut.println("Welcme t Java!"); 48
49 Trace fr Lp, cnt. int i; fr (i = 0; i < 2; i++) { System.ut.println("Welcme t Java!"); (i < 2) is still true since i is 1 49
50 Trace fr Lp, cnt. int i; fr (i = 0; i < 2; i++) { System.ut.println("Welcme t Java!"); Print Welcme t Java 50
51 Trace fr Lp, cnt. Execute adjustment statement int i; i nw is 2 fr (i = 0; i < 2; i++) { System.ut.println("Welcme t Java!"); 51
52 Trace fr Lp, cnt. int i; fr (i = 0; i < 2; i++) { System.ut.println("Welcme t Java!"); (i < 2) is false since i is 2 52
53 Trace fr Lp, cnt. Exit the lp. Execute the next int i; statement after the lp fr (i = 0; i < 2; i++) { System.ut.println("Welcme t Java!"); Let s lk at the cde example. 53
54 Nte Yu may declare the cntrl variable utside/within the fr-lp fr (int j = 0; j <= 5; j++) { System.ut.println ("Fr lp iteratin = " + j); int j; fr (j = 0; j <= 5; j++) { System.ut.println ("Fr lp iteratin = " + j); Nte n variable scpe (the area a variable can be referenced) Declaring cntrl variable befre the fr lp cause its scpe t be inside and utside frlp Declaring the cntrl variable in the fr-lp causes its scpe t be nly inside the fr lp If I tried t use the variable j utside the fr-lp - errr CS4500/5500 UC. Clrad Springs
55 Nte The initial-actin in a fr lp can be a list f zer r mre cmma-separated expressins. The actin-after-eachiteratin in a fr lp can be a list f zer r mre cmmaseparated statements. Therefre, the fllwing tw fr lps are crrect. They are rarely used in practice, hwever. fr (int i = 1; i < 100; System.ut.println(i++)); fr (int i = 0, j = 0; (i + j < 10); i++, j++) { // D smething 55
56 Nte If the lp-cntinuatin-cnditin in a fr lp is mitted, it is implicitly true. Thus the statement given belw in (a), which is an infinite lp, is crrect. Nevertheless, it is better t use the equivalent lp in (b) t avid cnfusin: fr ( ; ; ) { // D smething (a) Equivalent while (true) { // D smething (b) Eclipse nly allwed this t happen if there are n statements fllwing the fr- lp If statements fllwed the lp, Eclipse places an errr "unreachable cde" n the statement fllwing the lp 56
57 Cautin Adding a semicln at the end f the fr clause befre the lp bdy is a cmmn mistake, as shwn belw: fr (int i=0; i<10; i++); { Lgic Errr System.ut.println("i is " + i); 57
58 Cautin, cnt. Similarly, the fllwing lp is als wrng: int i=0; Lgic Errr while (i < 10); { System.ut.println("i is " + i); i++; In the case f the d lp, the fllwing semicln is needed t end the lp. int i=0; d { System.ut.println("i is " + i); i++; while (i<10); Crrect 58
59 Which Lp t Use? The three frms f lp statements, while, d-while, and fr, are expressively equivalent; that is, yu can write a lp in any f these three frms. Fr example, a while lp in (a) in the fllwing figure can always be cnverted int the fllwing fr lp in (b): while (lp-cntinuatin-cnditin) { // Lp bdy (a) Equivalent fr ( ; lp-cntinuatin-cnditin; ) // Lp bdy (b) A fr lp in (a) in the fllwing figure can generally be cnverted int the fllwing while lp in (b): fr (initial-actin; lp-cntinuatin-cnditin; actin-after-each-iteratin) { // Lp bdy; (a) Equivalent 59 initial-actin; while (lp-cntinuatin-cnditin) { // Lp bdy; actin-after-each-iteratin; (b)
60 Recmmendatins Use the ne that is mst intuitive and cmfrtable. In general, a fr lp may be used if the number f repetitins is knwn, as, fr example, when yu need t print a message 100 times. A while lp may be used if the number f repetitins is nt knwn, as in the case f reading the numbers until the input is 0. A d-while lp can be used t replace a while lp if the lp bdy has t be executed befre testing the cntinuatin cnditin. 60
61 Practice! Predicting tuitin The tuitin fr a university is currently $10,000. It will increase by 7% each year In hw many years will the tuitin be dubled? Which lp t use? Statement(s) t be repeated? Cnditin t check? CS4500/5500 UC. Clrad Springs
62 Fahrenheit2CelsiusFrLp example Hw t design using a lp? Can we rewrite this using a while lp? Let s g ver hw3 Break dwn a big prblem int smaller pieces CS4500/5500 UC. Clrad Springs
63 RandmNumbers example Math.randm() Returns a duble value, greater than r equal t 0.0 and less than 1.0, i.e., [0.0, 1.0) duble randmduble; randmduble = Math.randm(); // [0.0, 1.0) Hw t generate a randm duble in [0.0, 10.0)? randmduble = Math.randm() * 10; Hw t generate a randm integer in [0, 10)? int randmint; randmint = (int) (Math.randm() * 10); CS4500/5500 UC. Clrad Springs
64 RandmNumbers example Math.randm() Hw t generate a randm integer between [lwer, upper)? Example: int lwer=100, upper=120; randmduble = Math.randm(); // [0.0, 1.0) randmduble = randmduble * (upper-lwer); // [0.0, 20.0) randmduble = lwer + randmduble; // [100.0, 120.0) randmint = (int) randmduble; // cast duble à int Or in ne step randmint = (int) (lwer + Math.randm() * (upper-lwer)); CS4500/5500 UC. Clrad Springs
65 Nested Lps If statements can be nested If (blean expressin) { if(blean expressin) { statement(s); // end f inner if // end f uter if Lps can be nested t CS4500/5500 UC. Clrad Springs
66 Nested Lps While lp within a while lp int uter = 1; while (uter < 3) { System.ut.println ("The uter lp iteratin is = " + uter); //inner lp: It will d all iteratins befre uter lp des anther iteratin int inner = 1; while (inner <= 5) { System.ut.println (" The inner lp iteratin is = " + inner); inner++; uter++; CS4500/5500 UC. Clrad Springs
67 Nested Lps Fr lp within a fr lp fr (int uter = 1; uter < 3; uter++) { System.ut.println ("The uter lp iteratin is = " + uter); // This is the inner fr lp // It will d all iteratins befre uter lp des anther iteratin fr (int inner = 1; inner <= 5; inner++) { System.ut.println (" The inner lp iteratin is = " + inner); CS4500/5500 UC. Clrad Springs
68 Nested Lps Prblem: Write a prgram that uses nested fr lps t print a multiplicatin table. What if I nly want lwer half f the table? 68
69 Using break and cntinue Break in lps Used "break" in switch statements t end a case Can be used in a lp t terminate a lp Breaks ut f lp Cntinue in lps Used t end current iteratin f lp Prgram cntrl ges t end f lp bdy CS4500/5500 UC. Clrad Springs
70 break public class TestBreak { public static vid main(string[] args) { int sum = 0; int number = 0; while (number < 20) { number++; sum += number; if (sum >= 100) break; System.ut.println("The number is " + number); System.ut.println("The sum is " + sum); 70
71 cntinue public class TestCntinue { public static vid main(string[] args) { int sum = 0; int number = 0; while (number < 20) { number++; if (number == 10 number == 11) cntinue; sum += number; System.ut.println("The sum is " + sum); 71
72 Guessing Number Prblem Revisited Let s lk at AdditinQuiz (randm number + break example) 72
73 Using break and cntinue There are cases when the use f a break r cntinue in a lp is necessary Overusing r imprper use can make prgram hard t read, maintain, and debug. Best practice is t never use these unless yu have a specific situatin CS4500/5500 UC. Clrad Springs
74 Summary While lp D while lp Fr lp Breack and cntinue CS1150 UC. Clrad Springs
CS1150 Principles of Computer Science Midterm Review
CS1150 Principles f Cmputer Science Midterm Review Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang CS1150 UC. Clrad Springs Office hurs 10/15, Mnday, 12:05 12:50pm 10/17, Wednesday
More informationCS1150 Principles of Computer Science Methods
CS1150 Principles f Cmputer Science Methds Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang CS1150 UC. Clrad Springs Opening Prblem Find the sum f integers frm 1 t 10, frm 20
More informationCS1150 Principles of Computer Science Boolean, Selection Statements (Part II)
CS1150 Principles f Cmputer Science Blean, Selectin Statements (Part II) Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang CS1150 Review What s the scientific ntatin f 9,200,000?
More informationCS1150 Principles of Computer Science Methods
CS1150 Principles f Cmputer Science Methds Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang CS1150 UC. Clrad Springs Passing Parameters public static vid nprintln(string message,
More informationDECISION CONTROL CONSTRUCTS IN JAVA
DECISION CONTROL CONSTRUCTS IN JAVA Decisin cntrl statements can change the executin flw f a prgram. Decisin cntrl statements in Java are: if statement Cnditinal peratr switch statement If statement The
More informationThe Java if statement is used to test the condition. It checks Boolean condition: true or false. There are various types of if statement in java.
Java If-else Statement The Java if statement is used t test the cnditin. It checks Blean cnditin: true r false. There are varius types f if statement in java. if statement if-else statement if-else-if
More informationCS1150 Principles of Computer Science Final Review
CS1150 Principles f Cmputer Science Final Review Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang CS1150 UC. Clrad Springs Numerical Data Types Name Range Strage Size byte 2 7
More informationPreparation: Follow the instructions on the course website to install Java JDK and jgrasp on your laptop.
Lab 1 Name: Checked: (instructr r TA initials) Objectives: Learn abut jgrasp - the prgramming envirnment that we will be using (IDE) Cmpile and run a Java prgram Understand the relatinship between a Java
More informationEastern Mediterranean University School of Computing and Technology Information Technology Lecture2 Functions
Eastern Mediterranean University Schl f Cmputing and Technlgy Infrmatin Technlgy Lecture2 Functins User Defined Functins Why d we need functins? T make yur prgram readable and rganized T reduce repeated
More informationCS1150 Principles of Computer Science Introduction (Part II)
Principles f Cmputer Science Intrductin (Part II) Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang UC. Clrad Springs Review Terminlgy Class } Every Java prgram must have at least
More informationIteration Part 2. Review: Iteration [Part 1] Flow charts for two loop constructs. Review: Syntax of loops. while continuation_condition : statement1
Review: Iteratin [Part 1] Iteratin Part 2 CS111 Cmputer Prgramming Department f Cmputer Science Wellesley Cllege Iteratin is the repeated executin f a set f statements until a stpping cnditin is reached.
More informationCOP2800 Homework #3 Assignment Spring 2013
YOUR NAME: DATE: LAST FOUR DIGITS OF YOUR UF-ID: Please Print Clearly (Blck Letters) YOUR PARTNER S NAME: DATE: LAST FOUR DIGITS OF PARTNER S UF-ID: Please Print Clearly Date Assigned: 15 February 2013
More informationCS1150 Principles of Computer Science Boolean, Selection Statements (Part II)
CS1150 Principles f Cmputer Science Blean, Selectin Statements (Part II) Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang CS1150 Review What s the scientific ntatin f 9,200,000?
More informationCS1150 Principles of Computer Science Loops (Part II)
CS1150 Principles of Computer Science Loops (Part II) Yanyan Zhuang Department of Computer Science http://www.cs.uccs.edu/~yzhuang CS1150 UC. Colorado Springs Review Is this an infinite loop? Why (not)?
More informationCS1150 Principles of Computer Science Introduction
Principles f Cmputer Science Intrductin Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang UC. Clrad Springs Intr f Intr Yanyan Zhuang PhD in netwrk systems yzhuang@uccs.edu Office
More informationRelational Operators, and the If Statement. 9.1 Combined Assignments. Relational Operators (4.1) Last time we discovered combined assignments such as:
Relatinal Operatrs, and the If Statement 9/18/06 CS150 Intrductin t Cmputer Science 1 1 9.1 Cmbined Assignments Last time we discvered cmbined assignments such as: a /= b + c; Which f the fllwing lng frms
More informationPrimitive Types and Methods. Reference Types and Methods. Review: Methods and Reference Types
Primitive Types and Methds Java uses what is called pass-by-value semantics fr methd calls When we call a methd with input parameters, the value f that parameter is cpied and passed alng, nt the riginal
More informationLab 4. Name: Checked: Objectives:
Lab 4 Name: Checked: Objectives: Learn hw t test cde snippets interactively. Learn abut the Java API Practice using Randm, Math, and String methds and assrted ther methds frm the Java API Part A. Use jgrasp
More information1 Version Spaces. CS 478 Homework 1 SOLUTION
CS 478 Hmewrk SOLUTION This is a pssible slutin t the hmewrk, althugh there may be ther crrect respnses t sme f the questins. The questins are repeated in this fnt, while answers are in a mnspaced fnt.
More informationCS5530 Mobile/Wireless Systems Swift
Mbile/Wireless Systems Swift Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang UC. Clrad Springs cat annunce.txt_ imacs remte VNC access VNP: http://www.uccs.edu/itservices/services/netwrk-andinternet/vpn.html
More informationLab 1 - Calculator. K&R All of Chapter 1, 7.4, and Appendix B1.2
UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C SPRING 2012 Lab 1 - Calculatr Intrductin In this lab yu will be writing yur first
More informationProject #1 - Fraction Calculator
AP Cmputer Science Liberty High Schl Prject #1 - Fractin Calculatr Students will implement a basic calculatr that handles fractins. 1. Required Behavir and Grading Scheme (100 pints ttal) Criteria Pints
More informationLab 1 - Calculator. K&R All of Chapter 1, 7.4, and Appendix B1.2 Iterative Code Design handout Style Guidelines handout
UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C SPRING 2013 Lab 1 - Calculatr Intrductin Reading Cncepts In this lab yu will be
More informationTUTORIAL --- Learning About Your efolio Space
TUTORIAL --- Learning Abut Yur efli Space Designed t Assist a First-Time User Available t All Overview Frm the mment yu lg in t yur just created myefli accunt, yu will find help ntes t guide yu in learning
More informationReading and writing data in files
Reading and writing data in files It is ften very useful t stre data in a file n disk fr later reference. But hw des ne put it there, and hw des ne read it back? Each prgramming language has its wn peculiar
More informationLab 0: Compiling, Running, and Debugging
UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C SPRING 2012 Lab 0: Cmpiling, Running, and Debugging Intrductin Reading This is the
More informationChapter 6: Lgic Based Testing LOGIC BASED TESTING: This unit gives an indepth verview f lgic based testing and its implementatin. At the end f this unit, the student will be able t: Understand the cncept
More information- Replacement of a single statement with a sequence of statements(promotes regularity)
ALGOL - Java and C built using ALGOL 60 - Simple and cncise and elegance - Universal - Clse as pssible t mathematical ntatin - Language can describe the algrithms - Mechanically translatable t machine
More information$ARCSIGHT_HOME/current/user/agent/map. The files are named in sequential order such as:
Lcatin f the map.x.prperties files $ARCSIGHT_HOME/current/user/agent/map File naming cnventin The files are named in sequential rder such as: Sme examples: 1. map.1.prperties 2. map.2.prperties 3. map.3.prperties
More informationCS1150 Principles of Computer Science Math Functions, Characters and Strings
CS1150 Principles f Cmputer Science Math Functins, Characters and Strings Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang CS1150 UC. Clrad Springs Mathematical Functins Java
More informationFIREWALL RULE SET OPTIMIZATION
Authr Name: Mungle Mukupa Supervisr : Mr Barry Irwin Date : 25 th Octber 2010 Security and Netwrks Research Grup Department f Cmputer Science Rhdes University Intrductin Firewalls have been and cntinue
More informationAnnouncement. VHDL in Action. Review. Statements. Process Execution with no sensitivity list. Sequential Statements
Annuncement Prject 2: Assigned tday, due 9/30 ning f class. VHDL in Actin Mdeling a binary/gray cunter. As always, start early Chapter 3 Sequential Statements 1 Review Statements Architecture bdy Cncurrent
More informationSystems & Operating Systems
McGill University COMP-206 Sftware Systems Due: Octber 1, 2011 n WEB CT at 23:55 (tw late days, -5% each day) Systems & Operating Systems Graphical user interfaces have advanced enugh t permit sftware
More informationBeyond Verification. Software Synthesis
Beynd Verificatin Sftware Synthesis 1 What d we mean by synthesis We want t get cde frm high-level specs - Pythn and VB are pretty high level, why is that nt synthesis? Supprt cmpsitinal and incremental
More informationTips and Tricks in Word 2000 Part II. Presented by Carla Torgerson
Tips and Tricks in Wrd 2000 Part II Presented by Carla Trgersn (cnt2@psu.edu) 1. using styles Styles are used t create frmatting shrtcuts s yu can create a dcument that has frmatting cnsistency. Fr example,
More informationLAB 7 (June 29/July 4) Structures, Stream I/O, Self-referential structures (Linked list) in C
LAB 7 (June 29/July 4) Structures, Stream I/O, Self-referential structures (Linked list) in C Due: July 9 (Sun) 11:59 pm 1. Prblem A Subject: Structure declaratin, initializatin and assignment. Structure
More informationINSTALLING CCRQINVOICE
INSTALLING CCRQINVOICE Thank yu fr selecting CCRQInvice. This dcument prvides a quick review f hw t install CCRQInvice. Detailed instructins can be fund in the prgram manual. While this may seem like a
More informationWorkflow Exception Routing for edocs
Wrkflw Exceptin Ruting fr edcs Dcuments that have been apprved by all necessary ndes in wrkflw and are sent t the enrllment engine, but fail fr sme reasn are sent t exceptin ruting. There is ne wrkgrup
More informationProgramming Project: Building a Web Server
Prgramming Prject: Building a Web Server Submissin Instructin: Grup prject Submit yur cde thrugh Bb by Dec. 8, 2014 11:59 PM. Yu need t generate a simple index.html page displaying all yur grup members
More informationCustomer Self-Service Center Migration Guide
Custmer Self-Service Center Migratin Guide These instructins intrduce yu t the new Custmer Prtal, which is replacing the lder Custmer Self-Service Center, and guides yu thrugh the migratin. Dn t wrry:
More informationQualtrics Instructions
Create a Survey/Prject G t the Ursinus Cllege hmepage and click n Faculty and Staff. Click n Qualtrics. Lgin t Qualtrics using yur Ursinus username and passwrd. Click n +Create Prject. Chse Research Cre.
More informationThe UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Yu will learn the fllwing in this lab: The UNIVERSITY f NORTH CAROLINA at CHAPEL HILL Cmp 541 Digital Lgic and Cmputer Design Spring 2016 Lab Prject (PART A): A Full Cmputer! Issued Fri 4/8/16; Suggested
More informationAccess the site directly by navigating to in your web browser.
GENERAL QUESTIONS Hw d I access the nline reprting system? Yu can access the nline system in ne f tw ways. G t the IHCDA website at https://www.in.gv/myihcda/rhtc.htm and scrll dwn the page t Cmpliance
More informationHP MPS Service. HP MPS Printer Identification Stickers
HP MPS Service We welcme yu t HP Managed Print Services (MPS). Fllwing yu will find infrmatin regarding: HP MPS printer identificatin stickers Requesting service and supplies fr devices n cntract Tner
More informationTRAINING GUIDE. Lucity Mobile
TRAINING GUIDE The Lucity mbile app gives users the pwer f the Lucity tls while in the field. They can lkup asset infrmatin, review and create wrk rders, create inspectins, and many mre things. This manual
More informationUiPath Automation. Walkthrough. Walkthrough Calculate Client Security Hash
UiPath Autmatin Walkthrugh Walkthrugh Calculate Client Security Hash Walkthrugh Calculate Client Security Hash Start with the REFramewrk template. We start ff with a simple implementatin t demnstrate the
More informationFIT 100. Lab 10: Creating the What s Your Sign, Dude? Application Spring 2002
FIT 100 Lab 10: Creating the What s Yur Sign, Dude? Applicatin Spring 2002 1. Creating the Interface fr SignFinder:... 1 2. Creating Variables t hld values... 4 3. Assigning Values t Variables... 4 4.
More informationGreeting a client who is coming back to your salon Consulting with a client you have worked with before Describing several different hairstyles
Unit 3 Greeting a Returning Custmer Objectives: Greeting a client wh is cming back t yur saln Cnsulting with a client yu have wrked with befre Describing several different hairstyles It is nt enugh t get
More informationhtml o Choose: Java SE Development Kit 8u45
ITSS 3211 Intrductin f Prgramming 1 Curse ITSS 3211 Intrductin t Prgramming Instructr Jytishka Ray Term Summer 2016 Meetings Mndays, 6 p.m. 8:45 p.m. Rm JSOM 12.202 Instructr: Jytishka Ray Email: jxr114030@utdallas.edu
More informationOwner Support+ FAQ s and Tips
Owner Supprt+ FAQ s and Tips Frequently Asked Questins Owner Supprt+ Vide Delivery Checklists: Fr mre infrmatin please reference the Owner Supprt+ (Overview) link just belw the Owner Supprt+ Delivery Checklist
More informationBut for better understanding the threads, we are explaining it in the 5 states.
Life cycle f a Thread (Thread States) A thread can be in ne f the five states. Accrding t sun, there is nly 4 states in thread life cycle in java new, runnable, nn-runnable and terminated. There is n running
More informationReport Writing Guidelines Writing Support Services
Reprt Writing Guidelines Writing Supprt Services Overview The guidelines presented here shuld give yu an idea f general cnventins fr writing frmal reprts. Hwever, yu shuld always cnsider yur particular
More informationCopyrights and Trademarks
Cpyrights and Trademarks Sage One Accunting Cnversin Manual 1 Cpyrights and Trademarks Cpyrights and Trademarks Cpyrights and Trademarks Cpyright 2002-2014 by Us. We hereby acknwledge the cpyrights and
More informationUiPath Automation. Walkthrough. Walkthrough Calculate Client Security Hash
UiPath Autmatin Walkthrugh Walkthrugh Calculate Client Security Hash Walkthrugh Calculate Client Security Hash Start with the REFramewrk template. We start ff with a simple implementatin t demnstrate the
More informationAP Computer Science A
2018 AP Cmputer Science A Sample Student Respnses and Scring Cmmentary Inside: Free Respnse Questin 1 RR Scring Guideline RR Student Samples RR Scring Cmmentary 2018 The Cllege Bard. Cllege Bard, Advanced
More informationData Miner Platinum. DataMinerPlatinum allows you to build custom reports with advanced queries. Reports > DataMinerPlatinum
Data Miner Platinum DataMinerPlatinum allws yu t build custm reprts with advanced queries. Reprts > DataMinerPlatinum Click Add New Recrd. Mve thrugh the tabs alng the tp t build yur reprt, with the end
More informationQuick start guide: Working in Transit NXT with a PPF
Quick start guide: Wrking in Transit NXT with a PPF STAR UK Limited Cntents What is a PPF?... 3 What are language pairs?... 3 Hw d I pen the PPF?... 3 Hw d I translate in Transit NXT?... 6 What is a fuzzy
More informationQuerying Data with Transact SQL
Querying Data with Transact SQL Curse Cde: 20761 Certificatin Exam: 70-761 Duratin: 5 Days Certificatin Track: MCSA: SQL 2016 Database Develpment Frmat: Classrm Level: 200 Abut this curse: This curse is
More informationThe UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Yu will learn the fllwing in this lab: The UNIVERSITY f NORTH CAROLINA at CHAPEL HILL Designing a mdule with multiple memries Designing and using a bitmap fnt Designing a memry-mapped display Cmp 541 Digital
More informationTest Pilot User Guide
Test Pilt User Guide Adapted frm http://www.clearlearning.cm Accessing Assessments and Surveys Test Pilt assessments and surveys are designed t be delivered t anyne using a standard web brwser and thus
More informationAscii Art Capstone project in C
Ascii Art Capstne prject in C CSSE 120 Intrductin t Sftware Develpment (Rbtics) Spring 2010-2011 Hw t begin the Ascii Art prject Page 1 Prceed as fllws, in the rder listed. 1. If yu have nt dne s already,
More informationCSE 3320 Operating Systems Synchronization Jia Rao
CSE 3320 Operating Systems Synchrnizatin Jia Ra Department f Cmputer Science and Engineering http://ranger.uta.edu/~jra Recap f the Last Class Multiprcessr scheduling Tw implementatins f the ready queue
More informationCS5530 Mobile/Wireless Systems Android UI
Mbile/Wireless Systems Andrid UI Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang UC. Clrad Springs cat annunce.txt_ Assignment 2 will be psted sn Due after midterm I will be
More informationWord 2007 The Ribbon, the Mini toolbar, and the Quick Access Toolbar
Wrd 2007 The Ribbn, the Mini tlbar, and the Quick Access Tlbar In this practice yu'll get the hang f using the new Ribbn, and yu'll als master the use f the helpful cmpanin tls, the Mini tlbar and the
More informationRequesting Service and Supplies
HP MPS Service We welcme yu t HP Managed Print Services (MPS). Fllwing yu will find infrmatin regarding: HP MPS printer identificatin stickers Requesting service and supplies fr devices n cntract Tner
More informationPopulate and Extract Data from Your Database
Ppulate and Extract Data frm Yur Database 1. Overview In this lab, yu will: 1. Check/revise yur data mdel and/r marketing material (hme page cntent) frm last week's lab. Yu will wrk with tw classmates
More informationAutomatic imposition version 5
Autmatic impsitin v.5 Page 1/9 Autmatic impsitin versin 5 Descriptin Autmatic impsitin will d the mst cmmn impsitins fr yur digital printer. It will autmatically d flders fr A3, A4, A5 r US Letter page
More informationMcGill University School of Computer Science COMP-206. Software Systems. Due: September 29, 2008 on WEB CT at 23:55.
Schl f Cmputer Science McGill University Schl f Cmputer Science COMP-206 Sftware Systems Due: September 29, 2008 n WEB CT at 23:55 Operating Systems This assignment explres the Unix perating system and
More informationTRAINING GUIDE. Overview of Lucity Spatial
TRAINING GUIDE Overview f Lucity Spatial Overview f Lucity Spatial In this sessin, we ll cver the key cmpnents f Lucity Spatial. Table f Cntents Lucity Spatial... 2 Requirements... 2 Setup... 3 Assign
More informationAdverse Action Letters
Adverse Actin Letters Setup and Usage Instructins The FRS Adverse Actin Letter mdule was designed t prvide yu with a very elabrate and sphisticated slutin t help autmate and handle all f yur Adverse Actin
More informationQuick Tips
2017-2018 Quick Tips Belw are sme tips t help teachers register fr the Read t Succeed Prgram: G t www.sixflags.cm/read It will lk like this: If yu DO have an accunt frm last year, please lgin with yur
More informationData Structure Interview Questions
Data Structure Interview Questins A list f tp frequently asked Data Structure interview questins and answers are given belw. 1) What is Data Structure? Explain. Data structure is a way that specifies hw
More informationB ERKELEY. Homework 7: Homework 7 JavaScript and jquery: An Introduction. Part 1:
Hmewrk 7 JavaScript and jquery: An Intrductin Hmewrk 7: Part 1: This hmewrk assignment is cmprised f three files. Yu als need the jquery library. Create links in the head sectin f the html file (HW7.css,
More informationLab 5 Sorting with Linked Lists
UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C WINTER 2013 Lab 5 Srting with Linked Lists Intrductin Reading This lab intrduces
More informationChapter 2 Basic Operations
Chapter 2 Basic Operatins Lessn B String Operatins 10 Minutes Lab Gals In this Lessn, yu will: Learn hw t use the fllwing Transfrmatins: Set Replace Extract Cuntpattern Split Learn hw t apply certain Transfrmatins
More informationCSE 361S Intro to Systems Software Lab #2
Due: Thursday, September 22, 2011 CSE 361S Intr t Systems Sftware Lab #2 Intrductin This lab will intrduce yu t the GNU tls in the Linux prgramming envirnment we will be using fr CSE 361S this semester,
More informationEASTERN ARIZONA COLLEGE Java Programming I
EASTERN ARIZONA COLLEGE Java Prgramming I Curse Design 2011-2012 Curse Infrmatin Divisin Business Curse Number CMP 126 Title Java Prgramming I Credits 3 Develped by Jeff Baer Lecture/Lab Rati 2 Lecture/2
More informationIntegrating QuickBooks with TimePro
Integrating QuickBks with TimePr With TimePr s QuickBks Integratin Mdule, yu can imprt and exprt data between TimePr and QuickBks. Imprting Data frm QuickBks The TimePr QuickBks Imprt Facility allws data
More informationC pointers. (Reek, Ch. 6) 1 CS 3090: Safety Critical Programming in C
C pinters (Reek, Ch. 6) 1 Review f pinters A pinter is just a memry lcatin. A memry lcatin is simply an integer value, that we interpret as an address in memry. The cntents at a particular memry lcatin
More informationCSCI L Topics in Computing Fall 2018 Web Page Project 50 points
CSCI 1100-1100L Tpics in Cmputing Fall 2018 Web Page Prject 50 pints Assignment Objectives: Lkup and crrectly use HTML tags in designing a persnal Web page Lkup and crrectly use CSS styles Use a simple
More information3. If co-mingled materials are sorted at a MRF
1. Intrductin In WDF, materials can be reprted as cllected c-mingled in Q10, 11, 12, 14, 16, 17, 33 and 34. C-mingled materials can be srted either at the kerbside r via an autmated system at a Materials
More informationUpgrading Kaltura MediaSpace TM Enterprise 1.0 to Kaltura MediaSpace TM Enterprise 2.0
Upgrading Kaltura MediaSpace TM Enterprise 1.0 t Kaltura MediaSpace TM Enterprise 2.0 Assumptins: The existing cde was checked ut f: svn+ssh://mediaspace@kelev.kaltura.cm/usr/lcal/kalsurce/prjects/m ediaspace/scial/branches/production/website/.
More informationFaculty Textbook Adoption Instructions
Faculty Textbk Adptin Instructins The Bkstre has partnered with MBS Direct t prvide textbks t ur students. This partnership ffers ur students and parents mre chices while saving them mney, including ptins
More informationTL 9000 Quality Management System. Measurements Handbook. SFQ Examples
Quality Excellence fr Suppliers f Telecmmunicatins Frum (QuEST Frum) TL 9000 Quality Management System Measurements Handbk Cpyright QuEST Frum Sftware Fix Quality (SFQ) Examples 8.1 8.1.1 SFQ Example The
More informationREFWORKS: STEP-BY-STEP HURST LIBRARY NORTHWEST UNIVERSITY
REFWORKS: STEP-BY-STEP HURST LIBRARY NORTHWEST UNIVERSITY Accessing RefWrks Access RefWrks frm a link in the Bibligraphy/Citatin sectin f the Hurst Library web page (http://library.nrthwestu.edu) Create
More informationThese tasks can now be performed by a special program called FTP clients.
FTP Cmmander FAQ: Intrductin FTP (File Transfer Prtcl) was first used in Unix systems a lng time ag t cpy and mve shared files. With the develpment f the Internet, FTP became widely used t uplad and dwnlad
More informationLaboratory #13: Trigger
Schl f Infrmatin and Cmputer Technlgy Sirindhrn Internatinal Institute f Technlgy Thammasat University ITS351 Database Prgramming Labratry Labratry #13: Trigger Objective: - T learn build in trigger in
More informationComputer Organization and Architecture
Campus de Gualtar 4710-057 Braga UNIVERSIDADE DO MINHO ESCOLA DE ENGENHARIA Departament de Infrmática Cmputer Organizatin and Architecture 5th Editin, 2000 by William Stallings Table f Cntents I. OVERVIEW.
More informationExercises: Plotting Complex Figures Using R
Exercises: Pltting Cmplex Figures Using R Versin 2017-11 Exercises: Pltting Cmplex Figures in R 2 Licence This manual is 2016-17, Simn Andrews. This manual is distributed under the creative cmmns Attributin-Nn-Cmmercial-Share
More informationStealing passwords via browser refresh
Stealing passwrds via brwser refresh Authr: Karmendra Khli [karmendra.khli@paladin.net] Date: August 07, 2004 Versin: 1.1 The brwser s back and refresh features can be used t steal passwrds frm insecurely
More informationOnce the Address Verification process is activated, the process can be accessed by employees in one of two ways:
Type: System Enhancements ID Number: SE 94 Date: June 29, 2012 Subject: New Address Verificatin Prcess Suggested Audience: Human Resurce Offices Details: Sectin I: General Infrmatin fr Address Verificatin
More informationUBC BLOGS NSYNC PLUGIN
UBC BLOGS NSYNC PLUGIN THE NSYNC 1.1 PLUGIN IN UBC BLOGS ALLOWS YOU TO PERMIT OTHER SITES TO PUSH CONTENT FROM THEIR SITE TO YOUR SITE BY ASSIGNING POSTS TO PRE-DETERMINED CATEGORIES. As shwn belw, psts
More informationCISC-103: Web Applications using Computer Science
CISC-103: Web Applicatins using Cmputer Science Instructr: Debra Yarringtn Email: yarringt@eecis.udel.edu Web Site: http://www.eecis.udel.edu/~yarringt TA: Patrick McClry Email: patmcclry@gmail.cm Office:
More informationWelcome to Remote Access Services (RAS) Virtual Desktop vs Extended Network. General
Welcme t Remte Access Services (RAS) Our gal is t prvide yu with seamless access t the TD netwrk, including the TD intranet site, yur applicatins and files, and ther imprtant wrk resurces -- whether yu
More informationPAGE NAMING STRATEGIES
PAGE NAMING STRATEGIES Naming Yur Pages in SiteCatalyst May 14, 2007 Versin 1.1 CHAPTER 1 1 Page Naming The pagename variable is used t identify each page that will be tracked n the web site. If the pagename
More informationLab 2 Temperature Measurement System
GOALS Lab 2 Temperature Measurement System 1) Build and test a thermistr circuit. 2) Write an Arduin prgram t acquire and send vltage data t a cmputer using the serial prt. 3) Write a MATLAB prgram t:
More informationWorking With Audacity
Wrking With Audacity Audacity is a free, pen-surce audi editing prgram. The majr user interface elements are highlighted in the screensht f the prgram s main windw belw. The editing tls are used t edit
More informationof Prolog An Overview 1.1 An example program: defining family relations
An Overview f Prlg This chaptereviews basic mechanisms f Prlg thrugh an example prgram. Althugh the treatment is largely infrmal many imprtant cncepts are intrduced. 1.1 An example prgram: defining family
More informationKNX integration for Project Designer
KNX integratin fr Prject Designer Intrductin With this KNX integratin t Prject Designer it is pssible t cntrl KNX devices like n/ff, dimming, blinds, scene cntrl etc. This implementatin is intended fr
More informationStudent Handbook for E*Value
Student Handbk fr E*Value The E*Value sftware prgram will be used thrughut yur fieldwrk experiences t find ut where yu re scheduled, wh yur fieldwrk educatr will be, t lg yur hurs, and t cmplete all required
More information