data-centric-computing / dcic-public

Repository for (for now) filing bug reports about DCIC.
19 stars 2 forks source link

[DCIC Book]: Section 6.4: Incorrect value in *where* clause #40

Closed rawalplawit closed 1 year ago

rawalplawit commented 1 year ago

Contact Details

No response

Which Web page has the problem?

https://dcic-world.org/2022-01-25/Conditionals_and_Booleans.html#%28part._else-if%29

What's the problem?

In section 6.4 Asking Multiple Questions, the add-shipping function at the end has incorrect where clause.

Example

fun add-shipping(order-amt :: Number) -> Number:
 ....
where:
  add-shipping(10) is 10 + 4
  add-shipping(3.95) is 3.95 + 4
  add-shipping(20) is 20 + 8
  add-shipping(10.01) is 10.01 + 8
  add-shipping(30) is 30 + 12 <------------- shoud be 30 + 8
end

image

What browser are you seeing the problem on?

No response

kfisler commented 1 year ago

Fixed (thanks!). It will appear in a release later this weekend.