This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 5 \ 2 ) + 29 Mod ( 55 / 5 2 ) + 7 = 30 * 2 + 29 Mod ( 55 / 5 2 ) + 7 = 30 * 2 + 29 Mod ( 11 2 ) + 7 = 30 * 2 + 29 Mod 9 + 7 = 6 + 29 Mod 9 + 7 = 60 + 2 + 7 = 62 + 7 = 6 9 *Note: When arithmetic operations have equal precedence, you go from left to right (technically the terminology is called associativity). When you have two sets of parentheses, the sets have equal precedence, so you still go from left to right, set by set. To confirm that the answers above are correct create a simple program in Visual Basic with two labels and a button (see left print screen). Next, code Button1 with the following code for a click event (all controls/objects are using default names): Private Sub Button1_Click( ByVal sender As System.Object, ByVal. . Label1.Text = 40 Mod 7 * 2 \ 4  (20 * 5 + 1) e End Sub Lab l2.Text = 30 * (5 \ 2) + 29 Mod (55 / 5  2) + 7 Run the program, click on Button1, and the final answers should appear in the labels (see right print screen)...
View Full
Document
 Spring '10
 DavidBrodin

Click to edit the document details