17 Operator-precedence-probs-with_key

17 Operator-precedence-probs-with_key - result (the...

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

View Full Document Right Arrow Icon
OP1 – Operator Precedence (Dominance) Problems (rev: 3/5/12 dd) Assume that variables have the following values: A = 4000 B = 1000 C = 5 D = 10 E = 4 N = 2 R = 100 S = 500 The following problems are shown in the single-line format. Using precedence rules, calculate the result (the numerical answer) for each problem. 1. M = A + R – S/N 2. H = A + R * S / N 3. I = (A + R) * S / N 4. J = A - B – R * C N Rewrite these problems in single-line form using the precedence rules. Then solve for the numeric answer. 5. L = A - (( C * S ) + D * R ) N E - N
Background image of page 1

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

View Full DocumentRight Arrow Icon
OP1 – Operator Precedence (Dominance) Problems - KEY Assume that variables have the following values: A = 4000 C = 5 E = 4 R = 100 B = 1000 D = 10 N = 2 S = 500 The following problems are shown in the single-line format. Using precedence rules, calculate the
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: result (the numerical answer) for each problem. 1. M = A + R S / N 2. H = A + R * S / N Solution: M = 4000 + 100 - 500/2 Solution: H = 4000 + 100*500/2 = 4000 + 100 250 = 4000 + 100*250 = 3850 = 4000 + 25000 = 29000 3. I = (A + R)*S/N 4. J = A - B R * C N Solution: I = (4000 + 100) * 500/2 Solution: J = 4000 - 1000 - 100*5^2 = (4100) * 250 = 4000 - 1000 - 100*25 = 1,025,000 = 4000 - 1000 - 2500 = 4000 3500 = 500 Rewrite these problems in single-line form using the precedence rules. Then solve for the numeric answer. 5. L = A-(( C * S ) + D * R ) N E-N Solution = (A-((C*S) + D * R))/N^(E-N) = (4000 - ((5*500) + 10*100)/2^(4-2) = (4000 - (2500 + 1000)) / 2^2 = (4000 3500) / 4 = 500/4 = 125...
View Full Document

This document was uploaded on 03/05/2012.

Page1 / 2

17 Operator-precedence-probs-with_key - result (the...

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

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