// Variables //========== // These variables are special and are known to the simulator. declare start_year = 2000 // today's year declare start_month = 12 // today's month declare savings = 10000 // initial savings // Mortgage-related variables. These are special and are known to the simulator. // If you don't care about a mortgage then you can ignore them. declare house_price = 200000 // The price of the house you're saving up to buy declare minimum_percent_down = 20 // The % of purchase price you will pay at purchase time declare closing_costs = 4000 // a rough estimate of closing costs declare reserve_savings = 10000 // Savings you want held in reserve at purchase time // (i.e. savings not to be put toward purchase) declare loan_term = 15 // in years declare mortgage_rate = 0.08 // // Various income and expenses in your monthly budget declare annual_salary = 50000 declare tax_rate = 0.28 declare take_home_pay asset = annual_salary * (1-tax_rate) / 12 declare rent liability = 750 declare utilities liability = 150 declare food liability = 200 declare property_tax liability = 0 declare inflation = 0.04 declare bought_house // Columns //======== // There are a number of predefined columns: // Year - the current year // Month - current month // Savings - running count of total savings // NetIncome - Income minus Expenses this month // Income - sum of all asset variables. Recomputed each month. // Expenses - sum of all liability variables. Recomputed each month. // Events - names of all events that triggered this month. // You can also add your own columns: column "mortpymt" is mortgage_payment // This is a predefined variable column "rent" is rent // Events //======= // There are three prefined events: // startup - occurs in the first month of the simulation // term_start - occurs when the mortgage is initiated // term_end - occurs when the mortgage is complete // If multiple events trigger on the same date, their statements are // executed in the order they appear in this input file. // // You can define your own events as well. If you use a variable name // at the place of the eventname, the event will trigger if the value // of the variable is 1. event init is once at startup bought_house = 0 end declare car_payment liability = 0 event new_car is once at jul 2002 savings = savings - 10000 car_payment = 500 end event car_paid_off is once at jul 2005 car_payment = 0 end event Raise is yearly every oct annual_salary = annual_salary * 1.05 // 5% raise if (annual_salary > 150000) then annual_salary = 150000 // upper bound career-wise end if (annual_salary > 100000) then tax_rate = 0.31 // just rough, of course end take_home_pay = annual_salary * (1-tax_rate) / 12 end event Purchase_House is once at term_start bought_house = 1 rent = 0 property_tax = house_price/1000 * 13 / 12 // estimate as $13/1000 utilities = 250 print "The purchase price of the house is " house_price print "The mortage payment is " mortgage_payment end event inflation is monthly house_price = house_price * (1 + (inflation/12)) end event proptaxincr is yearly every jan if bought_house then // don't set this liability until you own the house property_tax = house_price/1000 * 13 / 12 // estimate as $13/1000 end end event House_Paid_Off is once at term_end print "----- Yahoo! -----" end event stopping is once at jan 2020 print "Dumping symboltable:\n" dump symboltable print "\n" print "some test cases:" print "8-4+3 = (should be 7) " 8-4+3 print "3+4*5 = (should be 23) " 3+4*5 print "\n" stop end