{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

engr1077_apr07

# engr1077_apr07 - LAURENTIAN UNIVERSITY UNIVERSITÉ...

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

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.

Unformatted text preview: LAURENTIAN UNIVERSITY UNIVERSITÉ LAURENTIENNE Course and No. Date .April12, 2007, 14:00 hrs.................. Cours et no ......ENGR 1077........................... Total no. of pages Nombre total de pages ....8........ questions ...15......... Professor Time allowed Professeur ...Ed Guerra................................... Durée de l'examen..3 hours....................................... Other instructions Autres directives Answer all questions. Incorrect answers for multiple choice questions will result in a 0.2 mark penalty. Incorrect answers for True/False questions will result in a 0.5 mark penalty. Part A: Multiple Choice (10 marks) 1. The gravitational force of attraction, F , between two bodies is given by the following formula: 2 2 1 d m m G F = Assuming that G, m1, m2, and d are have been properly declared and initialized, which of the following C++ statements correctly expresses the above formula? a) F = G/d*m1*m2/d; b) F = G*m1*m2/d*d; c) F = G*m1*m2/(d*d); d) a and c are correct e) b and c are correct 2. Given that Cost and Price are integers with the initial values of 5 and 10 respectively, what will be the resulting value of Cost after the following statement is executed? Cost = Price++ + ++Price; a) 10 b) 11 c) 20 d) 21 e) None of the above 3. If a1 is true and a2 is false, then which of the following expression are true? a) a1 && a2 b) a1 || a2 c) !(a1 || a2) d) !a1 && a2 e) None of the above 4. Which structure in C++ would you use to implement an algorithm that requires a decision to do one thing or another?...
View Full Document

{[ snackBarMessage ]}

### Page1 / 8

engr1077_apr07 - LAURENTIAN UNIVERSITY UNIVERSITÉ...

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

View Full Document
Ask a homework question - tutors are online