Lecture5 - Engineering Computation ENG 1D04 ENG 1D04...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Engineering Computation ENG ENG 1D04 1D04 Lecture 5: Recap … so far… and more… Mihai Albu
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Ifs if (condition is true) { //do something } else //if condition is false { //do something else }
Background image of page 2
3 Sample if (a > 0) { MessageBox.Show(“Positive number”); } else //that means a < 0 { MeesageBox.Show(“Negative number”); }
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Sample if (a > 0) { MessageBox.Show(“Positive number”); } else //that means a <= 0 { if (a < 0) { MeesageBox.Show(“Negative number”); } else //a = 0 MeesageBox.Show(“Number is 0”); }
Background image of page 4
5 for for (start value; condition; modifier) { //do something; }
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Sample int sum = 0; int x = 0; for (x = 0; x < 10; x++) { sum = sum + x; //or sum += x; } sum = ? x = ?
Background image of page 6
7 While while (condition is true) { //do something }
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/13/2010 for the course CIVIL 2oi4 taught by Professor Lamiar during the Fall '10 term at McMaster University.

Page1 / 23

Lecture5 - Engineering Computation ENG 1D04 ENG 1D04...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online