19
Lecture 12: Engineering Problem 2

Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

Embed Size (px)

Citation preview

Page 1: Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

Lecture 12: Engineering Problem 2

Page 2: Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

2

Learning Objectives

Experience in engineering problems

Lecture Topics

•Payback period

Page 3: Lecture 12: Engineering Problem 2. Outline 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.

Page 4: Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics 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

Page 5: Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

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.

Page 6: Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

Problem 1Input:•Investment•Expected Yearly Profits (Incomes)

Output•Balance•PayBack year

Algorithm•Payback year is found when Balance > 0 •Balance = -Investment + Accumulative Profit

Page 7: Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

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]);}

Page 8: Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

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];}

Page 9: Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

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]);}

Page 10: Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

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);}

}

Page 11: Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

Problem 1Test #1Project A: • investment = ฿65M

• profits of the first three years = ฿10M

• profits of the latter years = ฿15 M

Page 12: Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

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

Page 13: Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

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.

Page 14: Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

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

Page 15: Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

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);

Page 16: Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

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)

Page 17: Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

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];

Page 18: Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

Test #1

Project A: investment = ฿65M

profits of the first three years = ฿10M

profits of the latter years = ฿15 M

Page 19: Lecture 12: Engineering Problem 2. Outline 2 Learning Objectives Experience in engineering problems Lecture Topics Payback period

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