#pragma once #include #include #include "contract.h" typedef enum loan_type { BULLET, STRAIGHTLINE, MORTGAGE, } loan_type; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpadded" typedef struct loan { loan_type type; contract *c; } loan; #pragma clang diagnostic pop /**** BULLET LOAN ****/ contract *bullet_init(int n, int d, float r, float P); float bullet_update(contract *); void bullet_free(contract *c); /**** STRAIGHT LINE ****/ contract *sl_init(int n, int d, float r, float P); float sl_update(contract *); void sl_free(contract *); /**** MORTGAGE ****/ contract *mort_init(int n, int d, float r, float P); float mort_update(contract *); void mort_free(contract *); /**** GENERAL LOAN STUFF ****/ loan loan_init(loan_type type, int n, int d, float r, float P); float loan_update(loan); void loan_free(loan);