GNG 1106 Study Guide - Midterm Guide: Hypotenuse, Pseudocode, The Algorithm

279 views13 pages

Document Summary

Gng1106 examen de mi-session / midterm examination october 25th, 2008. The total number of points for the examination is 50. Use both sides of these sheets if necessary. 4 expression values give one of the symbolic constants true (1) or false (0) (5 points): int w=1, x=2; float y=1. 0, z=2. 0; float a[5] = {1, 2. 5, 3, 4. 1, 5}; Expression w % x a[2] >= z && y <= a[0] Value w + x/2 (a[4]+5. 1) >= 6. 5 || a[1] != y w<=x != y<=z (h) provide the c instruction(s) for the following pseudo-code (1 point): Assign a random integer between 0 and 9 to num. The following shows the output generated during an execution of the program shown on the next page: (note: this output snapshot is also available in the appendix separate document) On the following page, show how the contents of the working memory are changed by the execution of the program.