Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ideally how it should be set out:
- define f(x)
- return x^2
- define Algorithm()
- sum ← 0
- a ← 1
- b ← 2
- h ← 0.5
- left ← a
- right ← a + h
- while right ≤ b do
- arc ← sqrt(f(right) - f(left)^2 + h^2)
- sum ← sum + arc
- left ← left + h
- right ← right + h
- end while
- print sum
- Alternatively and acceptably:
- define f(x)
- return x^2
- sum ← 0
- a ← 1
- b ← 2
- h ← 0.5
- left ← a
- right ← a + h
- while right ≤ b do
- arc ← sqrt(f(right) - f(left)^2 + h^2)
- sum ← sum + arc
- left ← left + h
- right ← right + h
- end while
- print sum
Advertisement
Add Comment
Please, Sign In to add comment