Lecture12 - Engineering Computation ENG 1D04 Lecture 12:...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Engineering Computation ENG 1D04 Lecture 12: some review Mihai Albu Copyright 2008 Alan Wassyng & Mihai Albu 1 Copyright 2008 Alan Wassyng & Mihai Albu 2 Copyright 2008 Alan Wassyng & Mihai Albu 3 Question 1. 2 marks How do you pass the 1D04 course? Answer 1. A. Drink a lot of beers B. Cheat on labs, quizzes and exams C. Practice, practice & practice D. A and B only E. None of the above Copyright 2008 Alan Wassyng & Mihai Albu 4 Variables int x; x = 5; x = 11 / 3; // x = 3 x = (int) Math.Sqrt(7); //x = 2 Rounding down Copyright 2008 Alan Wassyng & Mihai Albu 5 Variables double y; y = 5.3456; y = 11 / 3; //y = 3 y = Math.Sqrt(7) ; //y = 2.646 Explicit conversion Copyright 2008 Alan Wassyng & Mihai Albu 6 Variables double y; y = 5.3456; y = (double)11 / 3; //y = 3.666 y = Math.Sqrt(7) ; //y = 2.646 Copyright 2008 Alan Wassyng & Mihai Albu 7 Variables double y; y = 5.3456; y = 11.0 / 3.0; //y = 3.666 y = Math.Sqrt(7) ; //y = 2.646 Copyright 2008 Alan Wassyng & Mihai Albu 8 Maths int x = (int) Math.Sqrt((Math.Pow(3,2) + 3) / (int) (1 + 4.5 / 1.5)); int x = (int) Math.Sqrt((9 + 3) / (int) (1 + 4.5 / 1.5)); int x = (int) Math.Sqrt((9 + 3) / (int) (1 + 3)); int x = (int) Math.Sqrt(12 / 4); int x = (int) Math.Sqrt(3); int x = 1; Copyright 2008 Alan Wassyng & Mihai Albu 9 Strings String s = I love this course; MessageBox.Show(s); MessageBox.Show(s + 1D04); Copyright 2008 Alan Wassyng & Mihai Albu 10 Strings String s = I love this course; String s1 = ABCD; MessageBox.Show (s + " " + 9 / 9 + s1.Substring(3, 1) + Math.Sqrt(16).ToString ("00!")); Copyright 2008 Alan Wassyng & Mihai Albu 11 Strings = array of characters?...
View Full 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 / 35

Lecture12 - Engineering Computation ENG 1D04 Lecture 12:...

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

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