#define BKS 4 // number of breakpoints at which // investments can be made #define NUM 3 // number of different kinds of CDs #define NA 0.0 // not applicable #define SC 3 // number of scenarios double infd, lq; double r[SC][NUM][BKS]; int mtrs[NUM][1+BKS], prchsbl[NUM][BKS], prob[SC], ttm[NUM]; data() { mtrs = { // CD i matures at breakpoint j if entry is 1 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1 }; prchsbl = { // CD i can be purchased at // breakpoint j if entry is 1 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0 }; ttm = { 1, 2, 4 }; // time to maturity in breakpoints r = { // return in scenarios on CD i at breakpoint j 1.02, 1.01785, 1.01625, 1.015, 1.0425, 1.040, 1.03875, NA, 1.09, NA, NA, NA, 1.02, 1.02, 1.02, 1.02, 1.0425, 1.0425, 1.0425, NA, 1.09, NA, NA, NA, 1.02, 1.0225, 1.02375, 1.03, 1.0425, 1.045, 1.04625, NA, 1.09, NA, NA, NA }; prob = { .25, .35, .4 }; // probabilities of scenarios } 2lp_main() { continuous Cd[SC][NUM][BKS],CashFlow[SC][BKS+1]; int type[NUM]; // for I/O infd = 100000; lq = 75000; data(); type = { 3, 6, 12 }; // duration of CDs and(int s=0;s= lq; and(int i=0;i