{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

Engineering Computation ENG 1D04 Lecture 12: some review… Mihai Albu

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

View Full Document

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

View Full Document
© 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

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

View Full Document
© 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

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

View Full Document
© 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;

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

View Full Document
© 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!"));

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

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

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern