Uppgjör Gunna við Atla og Jóa

Padelskuldir
mail@pastecode.io avatar
unknown
r
a month ago
640 B
2
Indexable
Never
N <- 19
n_done <- 3
class_ppp_quarter <- 2225
# Atli and Joi pay Tennishollin for all classes
single_payment_done <- 42275

# Payments to be divided by Atli, Joi, Gunni
n_left <- N - n_done
# We pay for 2 spots out of 4
total_payment_left <- n_left * class_ppp_quarter * 2
total_ppp_left <- total_payment_left / 3
# Gunni pays half of total owed to Atli and half to Joi
(gunni_pays_each <- total_ppp_left / 2)

# Check if payments add up
johann_should_pay <- n_done * class_ppp_quarter + total_ppp_left
johann_pays_with_reimbursment <- single_payment_done - gunni_pays_each
# Is 0?
johann_should_pay - johann_pays_with_reimbursment < 1e-10
Leave a Comment