diff --git a/code/Angabe4.lhs b/code/Angabe4.lhs index 6e2dc16..8802521 100644 --- a/code/Angabe4.lhs +++ b/code/Angabe4.lhs @@ -139,12 +139,12 @@ Helper functions: > int_to_month 11 = Nov > int_to_month 12 = Dez -> skonto_to_num :: Skonto -> Float +> skonto_to_num :: Skonto -> Int > skonto_to_num s > | s == KeinSkonto = 0 -> | s == DreiProzent = 0.03 -> | s == FuenfProzent = 0.05 -> | otherwise = 0.1 +> | s == DreiProzent = 3 +> | s == FuenfProzent = 5 +> | otherwise = 10 > full_months::[Monat] > full_months = [Jan, Mar, Mai, Jul, Aug, Okt, Dez] @@ -250,9 +250,9 @@ Aufgabe A.1 > | is_credit g = P_Gutschrift (gutschriftsbetrag g) (gutschrift_vom g) > | otherwise = AP_Zahlung n (zahlung_vom g) > where -> b = fromIntegral(cents (brutto g)) :: Float -- convert b to float +> b = cents (brutto g) > s = skonto_to_num (skonto g) -> n = C ((round(b - (b * s))) :: Nat1) +> n = C ((b - ((b * s) `div` 100)) :: Nat1) ===================================================================================