CSCI 152 Spring 2015 Exam 2: C Programming Language

Choose your option

Option 1(100 points)

Write the following functions:

Option 2(100 points): - with Arrays - challenging

For short-term investors who plan to buy, fix up and sell their properties right away, usually the following the after-repair-value formula is used:

purchase_price = 75% * (after_repair_value) - repair_expenses

In this formula, after_repair_value is the price that you can sell your home AFTER it is all fixed up.

Example: You see an older home on the market that is visibly rundown and needs repair, and the current market price is: $160,000 "as is." After you assess the damage, you estimate it will require $25,000 repair expenses. Homes of the same size in the neighborhood have been selling for $220,000 (after repair value) in "move-in, turn-key condition." You would need to buy the home for $140,000 or less to make it a worthwhile investment. (75 percent of $220,000 = $165,000. $165,000 minus $25,000 = $140,000.) It means that $160,000 is NOT a worthwhile investment.

In this program you will store all data in 3 arrays of double values. First array, double arv[SIZE] will hold After Repair Value for each house, second array, double re[SIZE] will hold Repair Expenses for each house, and third array, double market[SIZE] will hold current market price for each house.