Upload
caden-coppin
View
214
Download
0
Embed Size (px)
Citation preview
Lecture 12: Engineering Problem 2
2
Learning Objectives
Experience in engineering problems
Lecture Topics
•Payback period
Problem 1Problem Statement: Payback PeriodIn an investment, success of the business can be evaluated in many ways. One of the indices is “Payback Period”.
Definition: Payback period in business and economics refers to the period of time required for the return on an investment to "repay" the sum of the original investment.
For example, a $1000 investment which returned $500 per year would have a two year payback period.
Problem 1Example, a project
with ฿65M investment has profits of ฿10M in the first 3 years and ฿15M for the latter years.
Which year does it take to payback the investment?Answer: at the 6th year
PB after 5 years = PB at year 6
Problem 1TaskWrite a program that asks for the following data from user– initial investment, – expected yearly profits (incomes).
The program will evaluate for the first 10 years and try to find the Payback Period. It will display the yearly balance (the difference between the investment and the accumulative profit).
Constraint: Payback period is found when the balance becomes positive.
balance = -Investment + Accumulative Profit
Note: Accumulative Profit is the summation of profits from the first year until current considering year.
Problem 1Input:•Investment•Expected Yearly Profits (Incomes)
Output•Balance•PayBack year
Algorithm•Payback year is found when Balance > 0 •Balance = -Investment + Accumulative Profit
Problem 1Part1: Obtain user’s data Use function input to obtain
the investment amount the expected yearly profit
Simulate for the first 10 years. (for i = 1 : 10)
printf("How much do u want to invest?: ");scanf("%f",&invest);for(i=0;i<10;i++){
printf("What is your expected income in year %d: ",i+1);
scanf("%f",&income[i]);}
Problem 1Part2: Compute accumulative profit use variable named SumIncome to store the
accumulative profit. SumIncome is initialized to zero SumIncome = SumIcone + Income(i)
compute the Accumulative profits for 10 years (for i = 1 : 10)
sumincome = 0;for(i=0;i<10;i++){sumincome = sumincome+income[i];}
Problem 1Part3: Compute and display the balance valuesuse variable named Balance to store the balance
Balance = -Invest + SumIncome
display the balance value with fprintfcompute for 10 years, Balance is an array
for(i=0;i<10;i++){sumincome = sumincome+income[i];balance[i] = -invest + sumincome;printf("Year %d, expected balance = %.1f \n",i+1,balance[i]);}
Problem 1Part4: Search for Payback period Payback period is found when Balance > 0
sumincome = 0;pbyear = 0; //Do not have payback year yetfor(i=0;i<10;i++)
{sumincome = sumincome+income[i];balance[i] = -invest + sumincome;printf("Year %d, expected balance = %.1f \n",i+1,balance[i]);if (balance[i]>0 && pbyear <=0)
{pbyear = i+1;printf("Payback year from Year %d \n",pbyear);}
}
Problem 1Test #1Project A: • investment = ฿65M
• profits of the first three years = ฿10M
• profits of the latter years = ฿15 M
Problem 1Test#2Project B: • investment = ฿105M
• profits of the first three years = ฿8M
• profits of the next 3 years = ฿12M
• profits of the latter years = ฿15M
Problem 2Problem Statement: Payback Period + Scrap ValueIn some investment, the invested properties (such as buildings, vehicles, etc) have some values. The values are called “Scrap value”. Therefore, we can count the scrap value as a kind of balance.
Scrap may refer to anything that is leftover.
Problem 2Example: A dormitory is built up with ฿65M investment. if the owner sells the business, the building has a scrap value which is normally disproportional to time. For example, if sells – within 1 year: scrap value = ฿30M– within 5 years: scrap value = ฿15M– within 10 years: scrap value = ฿5M
Problem 2Assume: scrap value can be modeled as
Scrap Value (@ year i) = Invest/ (Year + 0.5)Ex.
Year 1: Scrap Value (1) = 65/(1 + 0.5) = 43.33Year 2: Scrap Value (2) = 65/(2 + 0.5) = 26.00Year 3: Scrap Value (3) = 65/(3 + 0.5) = 18.57…
thus Balance = - Invest + SumIncome + Scrap(@
year i);
Problem 2TaskWrite a program that asks for the following data from user– initial investment, – expected yearly profits.
The program will evaluate for the first 10 years and try to find the Payback Period. It will display the yearly balance. The yearly balance must include the scrap value as well.
Constraint: Payback period is found when the balance becomes positive.
Balance = -Investment + Accumulative Profit +Scrap Value(@year i) Scrap Value = Invest/ (Year + 0.5)
Problem 2Additional codes•Compute for the yearly Scrap Values
scrap[i] = invest/(i+1+0.5);
•edit the computation of Balance
balance[i] = -invest + sumincome + scrap[i];
Test #1
Project A: investment = ฿65M
profits of the first three years = ฿10M
profits of the latter years = ฿15 M
Test#2
Project B: investment = ฿105M
profits of the first three years = ฿8M
profits of the next 3 years = ฿12M
profits of the latter years = ฿15M