{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

1 Engineering Computation ENG ENG 1D04 1D04 Lecture 5: Recap … so far… and more… Mihai Albu

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

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

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

View Full Document
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”); }
5 for for (start value; condition; modifier) { //do something; }

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

View Full Document
6 Sample int sum = 0; int x = 0; for (x = 0; x < 10; x++) { sum = sum + x; //or sum += x; } sum = ? x = ?
7 While while (condition is true) { //do something }

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

View Full Document
8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online