Presentation is loading. Please wait.

Presentation is loading. Please wait.

More Program Flow Applications of Computer Programming in Earth Sciences Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National.

Similar presentations


Presentation on theme: "More Program Flow Applications of Computer Programming in Earth Sciences Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National."— Presentation transcript:

1 More Program Flow Applications of Computer Programming in Earth Sciences Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National Cheng Kung University Last updated: 12 October 2004 Chapter 7

2 Looping  goto Should be shunned Ex7-1

3 while Loop  while while (conditions) statement; Ex7-2 Ex7-3  continue and break Ex7-4

4 do … while Loop  do … while do statement while (conditions); Ex7-7

5 for Loops  for for(initialization; test; action) statement; Ex7-9  Multiple initialization and increments Ex7-10  Null statements Ex7-11  Nested loops Ex7-14

6 switch statements  switch switch(expression) { case valueOne: statement; case valueTwo: statement; … case valueN: statement; default: statement; } Ex7-16

7 Forever Loop  Using a switch statement with a menu Ex7-17


Download ppt "More Program Flow Applications of Computer Programming in Earth Sciences Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National."

Similar presentations


Ads by Google